msvcp90: Don't use throw_exception helper for runtime_error 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:21 +02:00 committed by Alexandre Julliard
parent b561d01305
commit 73c4ae66c2
4 changed files with 12 additions and 12 deletions

View File

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

View File

@ -924,10 +924,15 @@ void __cdecl _Xout_of_range(const char *str)
/* ?_Xruntime_error@std@@YAXPBD@Z */
/* ?_Xruntime_error@std@@YAXPEBD@Z */
void __cdecl _Xruntime_error(const char *str)
void __cdecl DECLSPEC_NORETURN _Xruntime_error(const char *str)
{
exception_name name = EXCEPTION_NAME(str);
runtime_error e;
TRACE("(%s)\n", debugstr_a(str));
throw_exception(EXCEPTION_RUNTIME_ERROR, str);
MSVCP_runtime_error_ctor(&e, name);
_CxxThrowException(&e, &runtime_error_cxx_type);
}
/* ?uncaught_exception@std@@YA_NXZ */
@ -1081,11 +1086,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_RUNTIME_ERROR: {
runtime_error e;
MSVCP_runtime_error_ctor(&e, name);
_CxxThrowException(&e, &runtime_error_cxx_type);
}
case EXCEPTION_FAILURE: {
failure e;
MSVCP_failure_ctor(&e, name);

View File

@ -520,7 +520,7 @@ _Locinfo* __cdecl _Locinfo__Locinfo_ctor_cat_cstr(_Locinfo *locinfo, int categor
FIXME("(%p %d %s) semi-stub\n", locinfo, category, locstr);
if(!locstr)
throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name");
_Xruntime_error("bad locale name");
_Lockit_ctor_locktype(&locinfo->lock, _LOCK_LOCALE);
locale_string_char_ctor(&locinfo->days);
@ -625,7 +625,7 @@ _Locinfo* __cdecl _Locinfo__Locinfo_Addcats(_Locinfo *locinfo, int category, con
/* This function is probably modifying more global objects */
FIXME("(%p %d %s) semi-stub\n", locinfo, category, locstr);
if(!locstr)
throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name");
_Xruntime_error("bad locale name");
locale_string_char_dtor(&locinfo->newlocname);
@ -11984,7 +11984,7 @@ locale* __thiscall locale_ctor_locale_cstr(locale *this, const locale *loc, cons
if(!memcmp(locale_string_char_c_str(&locinfo.newlocname), "*", 2)) {
_Locinfo_dtor(&locinfo);
operator_delete(this->ptr);
throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name");
_Xruntime_error("bad locale name");
}
this->ptr = operator_new(sizeof(locale__Locimp));
@ -12013,7 +12013,7 @@ locale* __thiscall locale_ctor_cstr(locale *this, const char *locname, category
if(!memcmp(locale_string_char_c_str(&locinfo.newlocname), "*", 2)) {
_Locinfo_dtor(&locinfo);
operator_delete(this->ptr);
throw_exception(EXCEPTION_RUNTIME_ERROR, "bad locale name");
_Xruntime_error("bad locale name");
}
locale__Locimp__Makeloc(&locinfo, cat, this->ptr, NULL);

View File

@ -667,3 +667,4 @@ 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);
void __cdecl DECLSPEC_NORETURN _Xruntime_error(const char*);