aboutsummaryrefslogtreecommitdiff
path: root/lparser.c
diff options
context:
space:
mode:
authorRoberto I <roberto@inf.puc-rio.br>2026-07-23 13:58:30 -0300
committerRoberto I <roberto@inf.puc-rio.br>2026-07-23 13:58:30 -0300
commit7579fc9d7ed90240487251dfb69168f8e64e9294 (patch)
treedbf17260333869dc4963c7b3c3dae98d7370e771 /lparser.c
parentd5bbe955840c5c83e37ed19df4d392d7ba0970ed (diff)
downloadlua-7579fc9d7ed90240487251dfb69168f8e64e9294.tar.gz
lua-7579fc9d7ed90240487251dfb69168f8e64e9294.tar.bz2
lua-7579fc9d7ed90240487251dfb69168f8e64e9294.zip
Small change in scope of variables in repeat-untilHEADv5.5.1master
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.
Diffstat (limited to 'lparser.c')
-rw-r--r--lparser.c2
1 files changed, 1 insertions, 1 deletions
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) {
1614 statlist(ls); 1614 statlist(ls);
1615 check_match(ls, TK_UNTIL, TK_REPEAT, line); 1615 check_match(ls, TK_UNTIL, TK_REPEAT, line);
1616 condexit = cond(ls); /* read condition (inside scope block) */ 1616 condexit = cond(ls); /* read condition (inside scope block) */
1617 leaveblock(fs); /* finish scope */
1618 if (bl2.upval) { /* upvalues? */ 1617 if (bl2.upval) { /* upvalues? */
1619 int exit = luaK_jump(fs); /* normal exit must jump over fix */ 1618 int exit = luaK_jump(fs); /* normal exit must jump over fix */
1620 luaK_patchtohere(fs, condexit); /* repetition must close upvalues */ 1619 luaK_patchtohere(fs, condexit); /* repetition must close upvalues */
@@ -1623,6 +1622,7 @@ static void repeatstat (LexState *ls, int line) {
1623 luaK_patchtohere(fs, exit); /* normal exit comes to here */ 1622 luaK_patchtohere(fs, exit); /* normal exit comes to here */
1624 } 1623 }
1625 luaK_patchlist(fs, condexit, repeat_init); /* close the loop */ 1624 luaK_patchlist(fs, condexit, repeat_init); /* close the loop */
1625 leaveblock(fs); /* finish scope */
1626 leaveblock(fs); /* finish loop */ 1626 leaveblock(fs); /* finish loop */
1627} 1627}
1628 1628