From 73c4ae66c2a4721f34978915c90c9ce7a32500f6 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Fri, 27 Aug 2021 13:48:21 +0200 Subject: [PATCH] msvcp90: Don't use throw_exception helper for runtime_error exception. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcp90/cxx.h | 1 - dlls/msvcp90/exception.c | 14 +++++++------- dlls/msvcp90/locale.c | 8 ++++---- dlls/msvcp90/msvcp90.h | 1 + 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/msvcp90/cxx.h b/dlls/msvcp90/cxx.h index 5bdebb605d6..0b14806d95c 100644 --- a/dlls/msvcp90/cxx.h +++ b/dlls/msvcp90/cxx.h @@ -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; diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index f635a80a90c..7b92b80d393 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -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); diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c index b0f1465fdce..0afe394ad2d 100644 --- a/dlls/msvcp90/locale.c +++ b/dlls/msvcp90/locale.c @@ -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); diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 144bf4d3a9a..3f862f1b2c1 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -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*);