From 8ceaafc159dabc5c0c5076fec5a512dc86087876 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 10 Nov 2013 19:13:22 -0800 Subject: [PATCH] armjit: Verify free space while compiling. --- Core/MIPS/ARM/ArmJit.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Core/MIPS/ARM/ArmJit.cpp b/Core/MIPS/ARM/ArmJit.cpp index 400e1d9c3d..91818de20b 100644 --- a/Core/MIPS/ARM/ArmJit.cpp +++ b/Core/MIPS/ARM/ArmJit.cpp @@ -279,6 +279,14 @@ const u8 *Jit::DoJit(u32 em_address, JitBlock *b) SetJumpTarget(skip); partialFlushOffset = GetCodePtr() - b->checkedEntry; } + + // Safety check, in case we get a bunch of really large jit ops without a lot of branching. + if (GetSpaceLeft() < 0x800) + { + FlushAll(); + WriteExit(js.compilerPC, js.nextExit++); + js.compiling = false; + } } if (jo.useForwardJump) {