diff options
Diffstat (limited to 'src/common/Debugging/WheatyExceptionReport.cpp')
-rw-r--r-- | src/common/Debugging/WheatyExceptionReport.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/Debugging/WheatyExceptionReport.cpp b/src/common/Debugging/WheatyExceptionReport.cpp index 16d14803205..af3f5052db8 100644 --- a/src/common/Debugging/WheatyExceptionReport.cpp +++ b/src/common/Debugging/WheatyExceptionReport.cpp @@ -564,10 +564,16 @@ PEXCEPTION_POINTERS pExceptionInfo) { PVOID exceptionObject = reinterpret_cast<PVOID>(pExceptionRecord->ExceptionInformation[1]); ThrowInfo const* throwInfo = reinterpret_cast<ThrowInfo const*>(pExceptionRecord->ExceptionInformation[2]); +#if _EH_RELATIVE_TYPEINFO + // When _EH_RELATIVE_TYPEINFO is defined, the pointers need to be retrieved with some pointer math auto resolveExceptionRVA = [pExceptionRecord](int32 rva) -> DWORD_PTR { return rva + (pExceptionRecord->NumberParameters >= 4 ? pExceptionRecord->ExceptionInformation[3] : 0); }; +#else + // Otherwise the pointers are already there in the API types + auto resolveExceptionRVA = [](void const* input) -> void const* { return input; }; +#endif CatchableTypeArray const* catchables = reinterpret_cast<CatchableTypeArray const*>(resolveExceptionRVA(throwInfo->pCatchableTypeArray)); CatchableType const* catchable = catchables->nCatchableTypes ? reinterpret_cast<CatchableType const*>(resolveExceptionRVA(catchables->arrayOfCatchableTypes[0])) : nullptr; |