From 0dd32ddb1405da62c260f7d50f12d280484606f1 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Wed, 23 Oct 2024 02:03:09 +0100 Subject: [PATCH] use script name in evt infinite loop check --- src/evt/evt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/evt/evt.c b/src/evt/evt.c index 0b83e5d36..a6771aa2d 100644 --- a/src/evt/evt.c +++ b/src/evt/evt.c @@ -1,5 +1,6 @@ #include "common.h" #include "vars_access.h" +#include "dx/backtrace.h" extern u32* gMapFlags; extern s32* gMapVars; @@ -1357,7 +1358,11 @@ s32 evt_execute_next_command(Evt* script) { s32 nargs; commandsExecuted++; - ASSERT_MSG(commandsExecuted < 10000, "Script %x is blocking for ages (infinite loop?)", script->ptrFirstLine); + if (commandsExecuted > 10000) { + char scriptName[0x40]; + backtrace_address_to_string(script->ptrFirstLine, scriptName); + PANIC_MSG("Script %s in infinite loop", scriptName); + } switch (script->curOpcode) { case EVT_OP_INTERNAL_FETCH: