diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2026-07-23 13:58:30 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2026-07-23 13:58:30 -0300 |
| commit | 7579fc9d7ed90240487251dfb69168f8e64e9294 (patch) | |
| tree | dbf17260333869dc4963c7b3c3dae98d7370e771 /lparser.c | |
| parent | d5bbe955840c5c83e37ed19df4d392d7ba0970ed (diff) | |
| download | lua-7579fc9d7ed90240487251dfb69168f8e64e9294.tar.gz lua-7579fc9d7ed90240487251dfb69168f8e64e9294.tar.bz2 lua-7579fc9d7ed90240487251dfb69168f8e64e9294.zip | |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -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 | ||
