From 4bbf5c562e31d4454afeac93f951fd4dcf1c6fc1 Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Sun, 15 Jan 2023 20:04:05 +0100 Subject: [PATCH] ssa: infinite loop in skipSingleBranchTarget Fixes Mat Hoffman's Pro BMX freeze when exiting a session. Issue #878 --- core/hw/sh4/dyna/ssa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/hw/sh4/dyna/ssa.h b/core/hw/sh4/dyna/ssa.h index b8ecc1c70..e713f4c35 100644 --- a/core/hw/sh4/dyna/ssa.h +++ b/core/hw/sh4/dyna/ssa.h @@ -734,7 +734,7 @@ private: bool success = false; const u32 start_page = block->vaddr >> 12; const u32 end_page = (block->vaddr + (block->guest_opcodes - 1) * 2) >> 12; - while (true) + for (int i = 0; i < 5; i++) { if ((addr >> 12) < start_page || ((addr + 2) >> 12) > end_page) break;