Fixes crash with +seh debug channel in https://github.com/microsoft/compiler-tests/blob/master/eh/ehthrow.cxx.
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/vcruntime140_1/except_x86_64.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/vcruntime140_1/except_x86_64.c b/dlls/vcruntime140_1/except_x86_64.c index 0e27b02db13..367d5563f1d 100644 --- a/dlls/vcruntime140_1/except_x86_64.c +++ b/dlls/vcruntime140_1/except_x86_64.c @@ -247,9 +247,17 @@ static inline void dump_type(UINT type_rva, ULONG64 base)
static void dump_exception_type(const cxx_exception_type *type, ULONG64 base) { - const cxx_type_info_table *type_info_table = rva_to_ptr(type->type_info_table, base); + const cxx_type_info_table *type_info_table; UINT i;
+ if (!type) + { + TRACE("NULL type\n"); + return; + } + + type_info_table = rva_to_ptr(type->type_info_table, base); + TRACE("flags %x destr %x(%p) handler %x(%p) type info %x(%p)\n", type->flags, type->destructor, rva_to_ptr(type->destructor, base), type->custom_handler, rva_to_ptr(type->custom_handler, base),
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/msvcrt/except_x86_64.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/except_x86_64.c b/dlls/msvcrt/except_x86_64.c index 09eddfb9793..d201ff59bbd 100644 --- a/dlls/msvcrt/except_x86_64.c +++ b/dlls/msvcrt/except_x86_64.c @@ -118,9 +118,17 @@ static inline void dump_type(UINT type_rva, ULONG64 base)
static void dump_exception_type(const cxx_exception_type *type, ULONG64 base) { - const cxx_type_info_table *type_info_table = rva_to_ptr(type->type_info_table, base); + const cxx_type_info_table *type_info_table; UINT i;
+ if (!type) + { + TRACE("NULL type\n"); + return; + } + + type_info_table = rva_to_ptr(type->type_info_table, base); + TRACE("flags %x destr %x(%p) handler %x(%p) type info %x(%p)\n", type->flags, type->destructor, rva_to_ptr(type->destructor, base), type->custom_handler, rva_to_ptr(type->custom_handler, base),