Thunk: Crash on XSetErrorHandler(NULL) (#2190)

* BUGFIX:Adding the nullptr check to FinalizeHostTrampolineForGuestFunction. It will lead crash on interpreter code set function nullptr callback. eg. XSetErrorHandler(NULL)

* fix #2189
This commit is contained in:
xianwei zheng authored and GitHub committed 2022-11-30 21:57:09 -08:00
1 parent c37fcf136a
commit 863a59a8e2
1 file changed
+3
@@ -431,6 +431,9 @@ namespace FEXCore {
FEX_DEFAULT_VISIBILITY
void FinalizeHostTrampolineForGuestFunction(HostToGuestTrampolinePtr* TrampolineAddress, void* HostPacker) {
if (TrampolineAddress == nullptr) return;
auto& Trampoline = GetInstanceInfo(TrampolineAddress);
LOGMAN_THROW_A_FMT(Trampoline.CallCallback == (uintptr_t)&ThunkHandler_impl::CallCallback,