Fix a crash if JIT space failed to allocate

This commit is contained in:
Henrik Rydgård committed 2020-12-02 00:33:51 +01:00
1 parent 2fef4c4a9c
commit c0a5fa3e8b
2 files changed
+6 -1

No files matched your search

+3
View File
@@ -71,6 +71,9 @@ public:
// Always clear code space with breakpoints, so that if someone accidentally executes
// uninitialized, it just breaks into the debugger.
void ClearCodeSpace(int offset) {
if (!region) {
return;
}
if (PlatformIsWXExclusive()) {
ProtectMemoryPages(region, region_size, MEM_PROT_READ | MEM_PROT_WRITE);
}
+3 -1
View File
@@ -1390,5 +1390,7 @@ VertexDecoderJitCache::VertexDecoderJitCache()
}
void VertexDecoderJitCache::Clear() {
ClearCodeSpace(0);
if (g_Config.iCpuCore == (int)CPUCore::JIT) {
ClearCodeSpace(0);
}
}