]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix endlessly growing try/catch stack when returning from run-loop
authorThomas Huth <huth@tuxfamily.org>
Sat, 26 Mar 2022 15:11:47 +0000 (16:11 +0100)
committerThomas Huth <huth@tuxfamily.org>
Sun, 17 Apr 2022 06:57:53 +0000 (08:57 +0200)
... 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

index ab30081a9313ebd5fd79570b9acb88c4073eead5..f7c79510cff5f4c990873303556cebe83c3dc1e5 100644 (file)
@@ -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;
+                                               }
                                        }
 
                                }