Daniel Lehman : msvcp90: Add std::range_error table.

Alexandre Julliard julliard at winehq.org
Fri Oct 13 18:44:15 CDT 2017


Module: wine
Branch: master
Commit: f664a991fdf52dfd142439be7ec4c2c9aaa7f1a0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f664a991fdf52dfd142439be7ec4c2c9aaa7f1a0

Author: Daniel Lehman <dlehman at esri.com>
Date:   Thu Oct 12 15:52:45 2017 -0700

msvcp90: Add std::range_error table.

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

---

 dlls/msvcp60/msvcp60.spec | 22 ++++++++---------
 dlls/msvcp90/cxx.h        |  1 +
 dlls/msvcp90/exception.c  | 63 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 75 insertions(+), 11 deletions(-)

diff --git a/dlls/msvcp60/msvcp60.spec b/dlls/msvcp60/msvcp60.spec
index d9e42bd..f496430 100644
--- a/dlls/msvcp60/msvcp60.spec
+++ b/dlls/msvcp60/msvcp60.spec
@@ -907,10 +907,10 @@
 @ stub -arch=win64 ??0overflow_error at std@@QEAA at AEBV01@@Z
 @ stub -arch=win32 ??0overflow_error at std@@QAE at ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1@@Z
 @ stub -arch=win64 ??0overflow_error at std@@QEAA at AEBV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1@@Z
-@ stub -arch=win32 ??0range_error at std@@QAE at ABV01@@Z
-@ stub -arch=win64 ??0range_error at std@@QEAA at AEBV01@@Z
-@ stub -arch=win32 ??0range_error at std@@QAE at ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1@@Z
-@ stub -arch=win64 ??0range_error at std@@QEAA at AEBV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1@@Z
+@ thiscall -arch=win32 ??0range_error at std@@QAE at ABV01@@Z(ptr ptr) MSVCP_range_error_copy_ctor
+@ cdecl -arch=win64 ??0range_error at std@@QEAA at AEBV01@@Z(ptr ptr) MSVCP_range_error_copy_ctor
+@ thiscall -arch=win32 ??0range_error at std@@QAE at ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1@@Z(ptr ptr) MSVCP_range_error_ctor_bstr
+@ cdecl -arch=win64 ??0range_error at std@@QEAA at AEBV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1@@Z(ptr ptr) MSVCP_range_error_ctor_bstr
 @ thiscall -arch=win32 ??0runtime_error at std@@QAE at ABV01@@Z(ptr ptr) MSVCP_runtime_error_copy_ctor
 @ cdecl -arch=win64 ??0runtime_error at std@@QEAA at AEBV01@@Z(ptr ptr) MSVCP_runtime_error_copy_ctor
 @ thiscall -arch=win32 ??0runtime_error at std@@QAE at ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1@@Z(ptr ptr) MSVCP_runtime_error_ctor_bstr
@@ -1083,8 +1083,8 @@
 @ cdecl -arch=win64 ??1out_of_range at std@@UEAA at XZ(ptr) MSVCP_logic_error_dtor
 @ stub -arch=win32 ??1overflow_error at std@@UAE at XZ
 @ stub -arch=win64 ??1overflow_error at std@@UEAA at XZ
-@ stub -arch=win32 ??1range_error at std@@UAE at XZ
-@ stub -arch=win64 ??1range_error at std@@UEAA at XZ
+@ thiscall -arch=win32 ??1range_error at std@@UAE at XZ(ptr) MSVCP_runtime_error_dtor
+@ cdecl -arch=win64 ??1range_error at std@@UEAA at XZ(ptr) MSVCP_runtime_error_dtor
 @ thiscall -arch=win32 ??1runtime_error at std@@UAE at XZ(ptr) MSVCP_logic_error_dtor
 @ cdecl -arch=win64 ??1runtime_error at std@@UEAA at XZ(ptr) MSVCP_logic_error_dtor
 @ thiscall -arch=win32 ??1strstream at std@@UAE at XZ(ptr) strstream_dtor
@@ -1257,8 +1257,8 @@
 @ cdecl -arch=win64 ??4out_of_range at std@@QEAAAEAV01 at AEBV01@@Z(ptr ptr) MSVCP_out_of_range_assign
 @ stub -arch=win32 ??4overflow_error at std@@QAEAAV01 at ABV01@@Z
 @ stub -arch=win64 ??4overflow_error at std@@QEAAAEAV01 at AEBV01@@Z
-@ stub -arch=win32 ??4range_error at std@@QAEAAV01 at ABV01@@Z
-@ stub -arch=win64 ??4range_error at std@@QEAAAEAV01 at AEBV01@@Z
+@ thiscall -arch=win32 ??4range_error at std@@QAEAAV01 at ABV01@@Z(ptr ptr) MSVCP_range_error_assign
+@ cdecl -arch=win64 ??4range_error at std@@QEAAAEAV01 at AEBV01@@Z(ptr ptr) MSVCP_range_error_assign
 @ thiscall -arch=win32 ??4runtime_error at std@@QAEAAV01 at ABV01@@Z(ptr ptr) MSVCP_runtime_error_assign
 @ cdecl -arch=win64 ??4runtime_error at std@@QEAAAEAV01 at AEBV01@@Z(ptr ptr) MSVCP_runtime_error_assign
 @ stub -arch=win32 ??4underflow_error at std@@QAEAAV01 at ABV01@@Z
@@ -1829,7 +1829,7 @@
 # extern ??_7money_base at std@@6B@
 @ extern ??_7out_of_range at std@@6B@ MSVCP_out_of_range_vtable
 # extern ??_7overflow_error at std@@6B@
-# extern ??_7range_error at std@@6B@
+@ extern ??_7range_error at std@@6B@ MSVCP_range_error_vtable
 @ extern ??_7runtime_error at std@@6B@ MSVCP_runtime_error_vtable
 # extern ??_7time_base at std@@6B@
 # extern ??_7underflow_error at std@@6B@
@@ -2045,8 +2045,8 @@
 @ cdecl -arch=win64 ?_Doraise at out_of_range@std@@MEBAXXZ(ptr) MSVCP_exception__Doraise
 @ stub -arch=win32 ?_Doraise at overflow_error@std@@MBEXXZ
 @ stub -arch=win64 ?_Doraise at overflow_error@std@@MEBAXXZ
-@ stub -arch=win32 ?_Doraise at range_error@std@@MBEXXZ
-@ stub -arch=win64 ?_Doraise at range_error@std@@MEBAXXZ
+@ thiscall -arch=win32 ?_Doraise at range_error@std@@MBEXXZ(ptr) MSVCP_exception__Doraise
+@ cdecl -arch=win64 ?_Doraise at range_error@std@@MEBAXXZ(ptr) MSVCP_exception__Doraise
 @ thiscall -arch=win32 ?_Doraise at runtime_error@std@@MBEXXZ(ptr) MSVCP_exception__Doraise
 @ cdecl -arch=win64 ?_Doraise at runtime_error@std@@MEBAXXZ(ptr) MSVCP_exception__Doraise
 @ stub -arch=win32 ?_Doraise at underflow_error@std@@MBEXXZ
diff --git a/dlls/msvcp90/cxx.h b/dlls/msvcp90/cxx.h
index 12a7f84..ddf9421 100644
--- a/dlls/msvcp90/cxx.h
+++ b/dlls/msvcp90/cxx.h
@@ -311,6 +311,7 @@ typedef enum __exception_type {
     EXCEPTION_INVALID_ARGUMENT,
     EXCEPTION_RUNTIME_ERROR,
     EXCEPTION_FAILURE,
+    EXCEPTION_RANGE_ERROR,
 } exception_type;
 void throw_exception(exception_type, const char *);
 
diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c
index c96f7a1..e62dfae 100644
--- a/dlls/msvcp90/exception.c
+++ b/dlls/msvcp90/exception.c
@@ -59,6 +59,8 @@ extern const vtable_ptr MSVCP_runtime_error_vtable;
 extern const vtable_ptr MSVCP_failure_vtable;
 /* ??_7bad_cast at std@@6B@ */
 extern const vtable_ptr MSVCP_bad_cast_vtable;
+/* ??_7range_error at std@@6B@ */
+extern const vtable_ptr MSVCP_range_error_vtable;
 
 static void MSVCP_type_info_dtor(type_info * _this)
 {
@@ -195,6 +197,8 @@ exception* __thiscall MSVCP_exception_assign(exception *this, const exception *a
 /* ?_Doraise at runtime_error@std@@MEBAXXZ */
 /* ?_Doraise at bad_cast@std@@MBEXXZ */
 /* ?_Doraise at bad_cast@std@@MEBAXXZ */
+/* ?_Doraise at range_error@std@@MBEXXZ */
+/* ?_Doraise at range_error@std@@MEBAXXZ */
 DEFINE_THISCALL_WRAPPER(MSVCP_exception__Doraise, 4)
 void __thiscall MSVCP_exception__Doraise(exception *this)
 {
@@ -585,6 +589,8 @@ runtime_error* __thiscall MSVCP_runtime_error_ctor_bstr(runtime_error *this, con
 
 /* ??1runtime_error at std@@UAE at XZ */
 /* ??1runtime_error at std@@UEAA at XZ */
+/* ??1range_error at std@@UAE at XZ */
+/* ??1range_error at std@@UEAA at XZ */
 DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_dtor, 4)
 void __thiscall MSVCP_runtime_error_dtor(runtime_error *this)
 {
@@ -766,6 +772,53 @@ bad_cast* __thiscall MSVCP_bad_cast_opequals(bad_cast *this, const bad_cast *rhs
 DEFINE_RTTI_DATA1(bad_cast, 0, &exception_rtti_base_descriptor, ".?AVbad_cast at std@@")
 DEFINE_CXX_DATA1(bad_cast, &exception_cxx_type_info, MSVCP_bad_cast_dtor)
 
+/* range_error class data */
+typedef runtime_error range_error;
+
+static range_error* MSVCP_range_error_ctor( range_error *this, exception_name name )
+{
+    TRACE("%p %s\n", this, EXCEPTION_STR(name));
+    MSVCP_runtime_error_ctor(this, name);
+    this->e.vtable = &MSVCP_range_error_vtable;
+    return this;
+}
+
+/* ??0range_error at std@@QAE at ABV01@@Z */
+/* ??0range_error at std@@QEAA at AEBV01@@Z */
+DEFINE_THISCALL_WRAPPER(MSVCP_range_error_copy_ctor, 8)
+range_error* __thiscall MSVCP_range_error_copy_ctor(
+        range_error *this, const range_error *rhs)
+{
+    TRACE("%p %p\n", this, rhs);
+    MSVCP_runtime_error_copy_ctor(this, rhs);
+    this->e.vtable = &MSVCP_range_error_vtable;
+    return this;
+}
+
+/* ??0range_error at std@@QAE at ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1@@Z */
+/* ??0range_error at std@@QEAA at AEBV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@1@@Z */
+#ifndef _MSVCIRT
+DEFINE_THISCALL_WRAPPER(MSVCP_range_error_ctor_bstr, 8)
+range_error* __thiscall MSVCP_range_error_ctor_bstr(range_error *this, const basic_string_char *str)
+{
+    const char *name = MSVCP_basic_string_char_c_str(str);
+    TRACE("(%p %p %s)\n", this, str, name);
+    return MSVCP_range_error_ctor(this, EXCEPTION_NAME(name));
+}
+#endif
+
+/* ??4range_error at std@@QAEAAV01 at ABV01@@Z */
+/* ??4range_error at std@@QEAAAEAV01 at AEBV01@@Z */
+DEFINE_THISCALL_WRAPPER(MSVCP_range_error_assign, 8)
+range_error* __thiscall MSVCP_range_error_assign(range_error *this, const range_error *assign)
+{
+    MSVCP_runtime_error_dtor(this);
+    return MSVCP_range_error_copy_ctor(this, assign);
+}
+
+DEFINE_RTTI_DATA2(range_error, 0, &runtime_error_rtti_base_descriptor, &exception_rtti_base_descriptor, ".?AVrange_error at std@@")
+DEFINE_CXX_DATA2(range_error, &runtime_error_cxx_type_info, &exception_cxx_type_info, MSVCP_runtime_error_dtor)
+
 /* ?_Nomemory at std@@YAXXZ */
 void __cdecl _Nomemory(void)
 {
@@ -856,6 +909,9 @@ void __asm_dummy_vtables(void) {
     EXCEPTION_VTABLE(bad_cast,
             VTABLE_ADD_FUNC(MSVCP_bad_cast_vector_dtor)
             VTABLE_ADD_FUNC(MSVCP_exception_what));
+    EXCEPTION_VTABLE(range_error,
+            VTABLE_ADD_FUNC(MSVCP_runtime_error_vector_dtor)
+            VTABLE_ADD_FUNC(MSVCP_exception_what));
 #ifndef __GNUC__
 }
 #endif
@@ -913,6 +969,11 @@ void throw_exception(exception_type et, const char *str)
         MSVCP_failure_ctor(&e, name);
         _CxxThrowException((exception*)&e, &failure_cxx_type);
     }
+    case EXCEPTION_RANGE_ERROR: {
+        range_error e;
+        MSVCP_range_error_ctor(&e, name);
+        _CxxThrowException((exception*)&e, &range_error_cxx_type);
+    }
     }
 }
 
@@ -929,6 +990,7 @@ void init_exception(void *base)
     init_runtime_error_rtti(base);
     init_failure_rtti(base);
     init_bad_cast_rtti(base);
+    init_range_error_rtti(base);
 
     init_exception_cxx(base);
     init_bad_alloc_cxx(base);
@@ -939,5 +1001,6 @@ void init_exception(void *base)
     init_runtime_error_cxx(base);
     init_failure_cxx(base);
     init_bad_cast_cxx(base);
+    init_range_error_cxx(base);
 #endif
 }




More information about the wine-cvs mailing list