set up so reusing scope when in a loop

This commit is contained in:
William Bell
2025-09-01 23:09:09 +01:00
parent 322716af0c
commit fd5b237dfe
10 changed files with 25 additions and 6 deletions

View File

@@ -683,6 +683,7 @@ static inline void run_instructions(Translated *translated, RuntimeState *state,
[OP_JUMP_IF_FALSE] = &&DO_JUMP_IF_FALSE,
[OP_JUMP] = &&DO_JUMP,
[OP_NEW_SCOPE] = &&DO_NEW_SCOPE,
[OP_EMPTY_SCOPE] = &&DO_EMPTY_SCOPE,
[OP_POP_SCOPE] = &&DO_POP_SCOPE,
[OP_INIT_CALL] = &&DO_INIT_CALL,
[OP_INSERT_ARG] = &&DO_INSERT_ARG,
@@ -745,6 +746,9 @@ DO_JUMP:
DO_NEW_SCOPE:
*stack = create_scope(*stack);
goto START;
DO_EMPTY_SCOPE:
clear_hashmap_GC((*stack)->scope);
goto START;
DO_POP_SCOPE:
*stack = (*stack)->prev;
goto START;