Kaydet (Commit) 4c951ee8 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Fix mscx_filterCppException base+offset pointer calculations

Change-Id: I9fbe8d7eba181cbfcab704761e6feebd78120644
üst a9585f34
...@@ -750,22 +750,23 @@ int mscx_filterCppException( ...@@ -750,22 +750,23 @@ int mscx_filterCppException(
// [3] is the image base address which is added the 32-bit // [3] is the image base address which is added the 32-bit
// rva_t fields in throwinfo to get actual 64-bit addresses // rva_t fields in throwinfo to get actual 64-bit addresses
ULONG_PTR base = pRecord->ExceptionInformation[3];
void * types = DWORD * types = reinterpret_cast<DWORD *>(
(void *) (pRecord->ExceptionInformation[3] + base
((RaiseInfo *)pRecord->ExceptionInformation[2])->_types); + (reinterpret_cast<RaiseInfo *>(pRecord->ExceptionInformation[2])
->_types));
if (types != 0 && *(DWORD *)types > 0) if (types != nullptr && types[0] != 0)
{ {
DWORD pType = *((DWORD *)types + 1); DWORD pType = types[1];
if (pType != 0 && ExceptionType * et
((ExceptionType *)(pRecord->ExceptionInformation[3]+pType))->_pTypeInfo != 0) = reinterpret_cast<ExceptionType *>(base + pType);
if (pType != 0 && et->_pTypeInfo != 0)
{ {
OUString aRTTIname( OUString aRTTIname(
OStringToOUString( OStringToOUString(
reinterpret_cast< __type_info * >( (reinterpret_cast<__type_info *>(base + et->_pTypeInfo)
((ExceptionType *)(pRecord->ExceptionInformation[3]+pType))->_pTypeInfo )->_m_d_name, ->_m_d_name),
RTL_TEXTENCODING_ASCII_US ) ); RTL_TEXTENCODING_ASCII_US));
OUString aUNOname( toUNOname( aRTTIname ) ); OUString aUNOname( toUNOname( aRTTIname ) );
typelib_TypeDescription * pExcTD = 0; typelib_TypeDescription * pExcTD = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment