From c9d107113bd3d0ab571663597f40b450d4e9d6c7 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Sat, 26 Mar 2022 16:11:47 +0100 Subject: [PATCH] Fix endlessly growing try/catch stack when returning from run-loop ... for the C implementations of this code (i.e. Hatari and Previous), where STOPTRY has to be used before returning from within a TRY-CATCH block. --- newcpu.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/newcpu.cpp b/newcpu.cpp index ab30081a..f7c79510 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -5537,8 +5537,10 @@ static void m68k_run_mmu040 (void) regs.instruction_cnt++; if (regs.spcflags) { - if (do_specialties (cpu_cycles)) + if (do_specialties(cpu_cycles)) { + STOPTRY; return; + } } } } CATCH (prb) { @@ -5652,8 +5654,10 @@ insretry: cpu_cycles = adjust_cycles (cpu_cycles); regs.instruction_cnt++; if (regs.spcflags) { - if (do_specialties (cpu_cycles)) + if (do_specialties(cpu_cycles)) { + STOPTRY; return; + } } } else { @@ -5661,8 +5665,10 @@ insretry: regs.instruction_cnt++; regs.ipl = regs.ipl_pin; if (regs.spcflags || time_for_interrupt ()) { - if (do_specialties (0)) + if (do_specialties(0)) { + STOPTRY; return; + } } } -- 2.47.3