aboutsummaryrefslogtreecommitdiff
path: root/src/common/Debugging/WheatyExceptionReport.cpp
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2020-12-31 19:55:55 +0100
committerjackpoz <giacomopoz@gmail.com>2020-12-31 19:55:55 +0100
commit1cafd4ef74350cb3656917e8e033a5e21dcce193 (patch)
treebd0a58e34668b7469e8e5b95f238605bf7ba1dc9 /src/common/Debugging/WheatyExceptionReport.cpp
parent803dc789e42ea2298a8bd1822849b6f2df82efe6 (diff)
Core/Misc: Fix Windows 32 bits build
Close #25789
Diffstat (limited to 'src/common/Debugging/WheatyExceptionReport.cpp')
-rw-r--r--src/common/Debugging/WheatyExceptionReport.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/Debugging/WheatyExceptionReport.cpp b/src/common/Debugging/WheatyExceptionReport.cpp
index e3d6bd43f27..55080cfa051 100644
--- a/src/common/Debugging/WheatyExceptionReport.cpp
+++ b/src/common/Debugging/WheatyExceptionReport.cpp
@@ -561,10 +561,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;