aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2020-12-31 19:55:55 +0100
committerShauren <shauren.trinity@gmail.com>2022-01-26 18:48:08 +0100
commit35755ba343fa6093d7459328226e1658e5989cd6 (patch)
treeffba5806f0bc5bdef21bb7230809cff259c9dcc4 /src/common
parentfbcf269207b41978221fba796bf3625536e7e68c (diff)
Core/Misc: Fix Windows 32 bits build
Close #25789 (cherry picked from commit 1cafd4ef74350cb3656917e8e033a5e21dcce193)
Diffstat (limited to 'src/common')
-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 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;