msvcp90: Don't use throw_exception helper for invalid_argument exception.

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:18 +02:00 committed by Alexandre Julliard
parent 6b7b6f45e1
commit b561d01305
4 changed files with 9 additions and 11 deletions

View File

@ -320,7 +320,6 @@ typedef enum __exception_type {
EXCEPTION_BAD_CAST,
EXCEPTION_LOGIC_ERROR,
EXCEPTION_OUT_OF_RANGE,
EXCEPTION_INVALID_ARGUMENT,
EXCEPTION_RUNTIME_ERROR,
EXCEPTION_FAILURE,
EXCEPTION_RANGE_ERROR,

View File

@ -890,10 +890,15 @@ void __cdecl DECLSPEC_NORETURN _Xmem(void)
/* ?_Xinvalid_argument@std@@YAXPBD@Z */
/* ?_Xinvalid_argument@std@@YAXPEBD@Z */
void __cdecl _Xinvalid_argument(const char *str)
void __cdecl DECLSPEC_NORETURN _Xinvalid_argument(const char *str)
{
exception_name name = EXCEPTION_NAME(str);
invalid_argument e;
TRACE("(%s)\n", debugstr_a(str));
throw_exception(EXCEPTION_INVALID_ARGUMENT, str);
MSVCP_invalid_argument_ctor(&e, name);
_CxxThrowException(&e, &invalid_argument_cxx_type);
}
/* ?_Xlength_error@std@@YAXPBD@Z */
@ -1076,11 +1081,6 @@ void throw_exception(exception_type et, const char *str)
MSVCP_out_of_range_ctor(&e, name);
_CxxThrowException(&e, &out_of_range_cxx_type);
}
case EXCEPTION_INVALID_ARGUMENT: {
invalid_argument e;
MSVCP_invalid_argument_ctor(&e, name);
_CxxThrowException(&e, &invalid_argument_cxx_type);
}
case EXCEPTION_RUNTIME_ERROR: {
runtime_error e;
MSVCP_runtime_error_ctor(&e, name);

View File

@ -664,5 +664,6 @@ static inline int mbstowcs_wrapper( size_t *ret, wchar_t *wcs, size_t size, cons
#endif
void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*);
void __cdecl DECLSPEC_NORETURN _Xinvalid_argument(const char*);
void __cdecl DECLSPEC_NORETURN _Xlength_error(const char*);
void __cdecl DECLSPEC_NORETURN _Xmem(void);

View File

@ -484,10 +484,8 @@ void __thiscall _String_base__Xran(const void/*_String_base*/ *this)
/* ?_Xinvarg@_String_base@std@@SAXXZ */
void CDECL MSVCP__String_base_Xinvarg(void)
{
static const char msg[] = "invalid string argument";
TRACE("\n");
throw_exception(EXCEPTION_INVALID_ARGUMENT, msg);
_Xinvalid_argument("invalid string argument");
}