summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-09 15:06:50 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-09 15:07:29 +0100
commit4c951ee83f8a554f1d3f94c46b9447d7d1c3bafa (patch)
tree53941fb15a78e4b315d333869d62c9c71b34639c /bridges
parenta9585f343b1642c119721de23dccf748de3c094a (diff)
Fix mscx_filterCppException base+offset pointer calculations
Change-Id: I9fbe8d7eba181cbfcab704761e6feebd78120644
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
index b6727ea5e257..70a6637772cd 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -750,22 +750,23 @@ int mscx_filterCppException(
// [3] is the image base address which is added the 32-bit
// rva_t fields in throwinfo to get actual 64-bit addresses
-
- void * types =
- (void *) (pRecord->ExceptionInformation[3] +
- ((RaiseInfo *)pRecord->ExceptionInformation[2])->_types);
-
- if (types != 0 && *(DWORD *)types > 0)
+ ULONG_PTR base = pRecord->ExceptionInformation[3];
+ DWORD * types = reinterpret_cast<DWORD *>(
+ base
+ + (reinterpret_cast<RaiseInfo *>(pRecord->ExceptionInformation[2])
+ ->_types));
+ if (types != nullptr && types[0] != 0)
{
- DWORD pType = *((DWORD *)types + 1);
- if (pType != 0 &&
- ((ExceptionType *)(pRecord->ExceptionInformation[3]+pType))->_pTypeInfo != 0)
+ DWORD pType = types[1];
+ ExceptionType * et
+ = reinterpret_cast<ExceptionType *>(base + pType);
+ if (pType != 0 && et->_pTypeInfo != 0)
{
OUString aRTTIname(
OStringToOUString(
- reinterpret_cast< __type_info * >(
- ((ExceptionType *)(pRecord->ExceptionInformation[3]+pType))->_pTypeInfo )->_m_d_name,
- RTL_TEXTENCODING_ASCII_US ) );
+ (reinterpret_cast<__type_info *>(base + et->_pTypeInfo)
+ ->_m_d_name),
+ RTL_TEXTENCODING_ASCII_US));
OUString aUNOname( toUNOname( aRTTIname ) );
typelib_TypeDescription * pExcTD = 0;