From 7579fc9d7ed90240487251dfb69168f8e64e9294 Mon Sep 17 00:00:00 2001 From: Roberto I Date: Thu, 23 Jul 2026 13:58:30 -0300 Subject: Small change in scope of variables in repeat-until A close instruction is still inside the scope of the variables it is closing. The extra close in a repeat-until (to close variables before repeating the loop) was being coded outside that scope. --- lparser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lparser.c') diff --git a/lparser.c b/lparser.c index fe29194c..3c26a4fd 100644 --- a/lparser.c +++ b/lparser.c @@ -1614,7 +1614,6 @@ static void repeatstat (LexState *ls, int line) { statlist(ls); check_match(ls, TK_UNTIL, TK_REPEAT, line); condexit = cond(ls); /* read condition (inside scope block) */ - leaveblock(fs); /* finish scope */ if (bl2.upval) { /* upvalues? */ int exit = luaK_jump(fs); /* normal exit must jump over fix */ luaK_patchtohere(fs, condexit); /* repetition must close upvalues */ @@ -1623,6 +1622,7 @@ static void repeatstat (LexState *ls, int line) { luaK_patchtohere(fs, exit); /* normal exit comes to here */ } luaK_patchlist(fs, condexit, repeat_init); /* close the loop */ + leaveblock(fs); /* finish scope */ leaveblock(fs); /* finish loop */ } -- cgit v1.2.3-55-g6feb