diff --git a/Source/Tools/FEXInterpreter/FEXInterpreter.cpp b/Source/Tools/FEXInterpreter/FEXInterpreter.cpp index aedb07b4d..d0b639e8a 100644 --- a/Source/Tools/FEXInterpreter/FEXInterpreter.cpp +++ b/Source/Tools/FEXInterpreter/FEXInterpreter.cpp @@ -601,8 +601,10 @@ int main(int argc, char** argv, char** const envp) { // Request code cache generation FEXServerClient::PopulateCodeCache(FEXServerClient::GetServerFD(), Loader.GetMainElfFD(), FEXCore::Config::Get_MULTIBLOCK()); - // Finalize code cache for libVDSO-guest.so. This needs to be done explicitly since VDSO doesn't use LoadLib. - SyscallHandler->TriggerGuestLibWrapperCodeCacheLoad(*ParentThread->Thread, reinterpret_cast(VDSOMapping.VDSOBase)); + if (VDSOMapping) { + // Finalize code cache for libVDSO-guest.so. This needs to be done explicitly since VDSO doesn't use LoadLib. + SyscallHandler->TriggerGuestLibWrapperCodeCacheLoad(*ParentThread->Thread, reinterpret_cast(VDSOMapping.VDSOBase)); + } } // Pull RIP and stack pointer from loader and set the thread data to it. diff --git a/Source/Tools/LinuxEmulation/VDSO_Emulation.h b/Source/Tools/LinuxEmulation/VDSO_Emulation.h index f05ba69bc..8a03409cb 100644 --- a/Source/Tools/LinuxEmulation/VDSO_Emulation.h +++ b/Source/Tools/LinuxEmulation/VDSO_Emulation.h @@ -21,6 +21,10 @@ struct VDSOMapping { size_t VDSOSize {}; void* X86GeneratedCodePtr {}; size_t X86GeneratedCodeSize {}; + + explicit operator bool() const { + return VDSOBase != nullptr; + } }; struct VDSOEntrypoints {