FEXCore: Don't initialize ThunkHandler on Win32

Adds a couple pointer checks to ensure it won't crash.

Doesn't work and will cause assertions.
This commit is contained in:
Ryan Houdek committed 2023-05-17 21:05:55 -07:00
1 parent cd0a340d29
commit 61ca651fe1
1 file changed
+8 -2
+8 -2
View File
@@ -308,7 +308,9 @@ namespace FEXCore::Context {
StopGdbServer();
}
#ifndef _WIN32
ThunkHandler = FEXCore::ThunkHandler::Create();
#endif
using namespace FEXCore::Core;
@@ -556,7 +558,9 @@ namespace FEXCore::Context {
Thread->ThreadManager.TID = FHU::Syscalls::gettid();
Thread->ThreadManager.PID = ::getpid();
SignalDelegation->RegisterTLSState(Thread);
ThunkHandler->RegisterTLSState(Thread);
if (ThunkHandler) {
ThunkHandler->RegisterTLSState(Thread);
}
}
void ContextImpl::RunThread(FEXCore::Core::InternalThreadState *Thread) {
@@ -1361,7 +1365,9 @@ namespace FEXCore::Context {
}
void ContextImpl::AppendThunkDefinitions(fextl::vector<FEXCore::IR::ThunkDefinition> const& Definitions) {
ThunkHandler->AppendThunkDefinitions(Definitions);
if (ThunkHandler) {
ThunkHandler->AppendThunkDefinitions(Definitions);
}
}
void ContextImpl::ConfigureAOTGen(FEXCore::Core::InternalThreadState *Thread, fextl::set<uint64_t> *ExternalBranches, uint64_t SectionMaxAddress) {