Skip to content

Commit

Permalink
use script name in evt infinite loop check
Browse files Browse the repository at this point in the history
  • Loading branch information
bates64 committed Oct 23, 2024
1 parent 26df52a commit 0dd32dd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/evt/evt.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "common.h"
#include "vars_access.h"
#include "dx/backtrace.h"

extern u32* gMapFlags;
extern s32* gMapVars;
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0dd32dd

Please sign in to comment.