Piotr Caban : msvcp90: Don't use throw_exception helper for runtime_error exception.

Alexandre Julliard julliard at winehq.org
Fri Aug 27 15:03:34 CDT 2021


Module: wine
Branch: master
Commit: 73c4ae66c2a4721f34978915c90c9ce7a32500f6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=73c4ae66c2a4721f34978915c90c9ce7a32500f6

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Fri Aug 27 13:48:21 2021 +0200

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

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 at std@@YAXPBD at Z */
 /* ?_Xruntime_error at std@@YAXPEBD at 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 at 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*);




More information about the wine-cvs mailing list