msvcp90: Introduce throw_range_error helper.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2021-08-27 13:48:29 +02:00 committed by Alexandre Julliard
parent 503f3462c6
commit 93455491fc
4 changed files with 12 additions and 8 deletions

View File

@ -320,7 +320,6 @@ typedef enum __exception_type {
EXCEPTION_BAD_CAST,
EXCEPTION_LOGIC_ERROR,
EXCEPTION_FAILURE,
EXCEPTION_RANGE_ERROR,
} exception_type;
void throw_exception(exception_type, const char *);

View File

@ -475,8 +475,7 @@ void __thiscall _vector_base_v4__Internal_throw_exception(void/*_vector_base_v4*
switch(idx) {
case 0: _Xout_of_range("Index out of range");
case 1: _Xout_of_range("Index out of segments table range");
case 2: throw_exception(EXCEPTION_RANGE_ERROR,
"Index is inside segment which failed to be allocated");
case 2: throw_range_error("Index is inside segment which failed to be allocated");
}
}

View File

@ -1091,14 +1091,19 @@ void throw_exception(exception_type et, const char *str)
MSVCP_failure_ctor(&e, name);
_CxxThrowException(&e, &failure_cxx_type);
}
case EXCEPTION_RANGE_ERROR: {
range_error e;
MSVCP_range_error_ctor(&e, name);
_CxxThrowException(&e, &range_error_cxx_type);
}
}
}
/* Internal: throws range_error exception */
void DECLSPEC_NORETURN throw_range_error(const char *str)
{
exception_name name = EXCEPTION_NAME(str);
range_error e;
MSVCP_range_error_ctor(&e, name);
_CxxThrowException(&e, &range_error_cxx_type);
}
void init_exception(void *base)
{
#ifdef __x86_64__

View File

@ -669,3 +669,4 @@ void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*);
void __cdecl DECLSPEC_NORETURN _Xmem(void);
void __cdecl DECLSPEC_NORETURN _Xout_of_range(const char*);
void __cdecl DECLSPEC_NORETURN _Xruntime_error(const char*);
void DECLSPEC_NORETURN throw_range_error(const char*);