diff options
author | Li Jin <dragon-fly@qq.com> | 2022-08-25 11:24:10 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2022-08-26 10:10:19 +0800 |
commit | df85ad2e7f975026ca1e6bd84b26fff81c8d99c8 (patch) | |
tree | 2b9300041c291382b15da3c354de3640a1498c1b /src/3rdParty/lua/lparser.c | |
parent | 2f497477c984e576e9ba7e8f6cb92ee9f794e56b (diff) | |
download | yuescript-df85ad2e7f975026ca1e6bd84b26fff81c8d99c8.tar.gz yuescript-df85ad2e7f975026ca1e6bd84b26fff81c8d99c8.tar.bz2 yuescript-df85ad2e7f975026ca1e6bd84b26fff81c8d99c8.zip |
update to Lua 5.4.5.
Diffstat (limited to 'src/3rdParty/lua/lparser.c')
-rw-r--r-- | src/3rdParty/lua/lparser.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/3rdParty/lua/lparser.c b/src/3rdParty/lua/lparser.c index a5cd552..fe693b5 100644 --- a/src/3rdParty/lua/lparser.c +++ b/src/3rdParty/lua/lparser.c | |||
@@ -674,19 +674,19 @@ static void leaveblock (FuncState *fs) { | |||
674 | LexState *ls = fs->ls; | 674 | LexState *ls = fs->ls; |
675 | int hasclose = 0; | 675 | int hasclose = 0; |
676 | int stklevel = reglevel(fs, bl->nactvar); /* level outside the block */ | 676 | int stklevel = reglevel(fs, bl->nactvar); /* level outside the block */ |
677 | if (bl->isloop) /* fix pending breaks? */ | 677 | removevars(fs, bl->nactvar); /* remove block locals */ |
678 | lua_assert(bl->nactvar == fs->nactvar); /* back to level on entry */ | ||
679 | if (bl->isloop) /* has to fix pending breaks? */ | ||
678 | hasclose = createlabel(ls, luaS_newliteral(ls->L, "break"), 0, 0); | 680 | hasclose = createlabel(ls, luaS_newliteral(ls->L, "break"), 0, 0); |
679 | if (!hasclose && bl->previous && bl->upval) | 681 | if (!hasclose && bl->previous && bl->upval) /* still need a 'close'? */ |
680 | luaK_codeABC(fs, OP_CLOSE, stklevel, 0, 0); | 682 | luaK_codeABC(fs, OP_CLOSE, stklevel, 0, 0); |
681 | fs->bl = bl->previous; | ||
682 | removevars(fs, bl->nactvar); | ||
683 | lua_assert(bl->nactvar == fs->nactvar); | ||
684 | fs->freereg = stklevel; /* free registers */ | 683 | fs->freereg = stklevel; /* free registers */ |
685 | ls->dyd->label.n = bl->firstlabel; /* remove local labels */ | 684 | ls->dyd->label.n = bl->firstlabel; /* remove local labels */ |
686 | if (bl->previous) /* inner block? */ | 685 | fs->bl = bl->previous; /* current block now is previous one */ |
687 | movegotosout(fs, bl); /* update pending gotos to outer block */ | 686 | if (bl->previous) /* was it a nested block? */ |
687 | movegotosout(fs, bl); /* update pending gotos to enclosing block */ | ||
688 | else { | 688 | else { |
689 | if (bl->firstgoto < ls->dyd->gt.n) /* pending gotos in outer block? */ | 689 | if (bl->firstgoto < ls->dyd->gt.n) /* still pending gotos? */ |
690 | undefgoto(ls, &ls->dyd->gt.arr[bl->firstgoto]); /* error */ | 690 | undefgoto(ls, &ls->dyd->gt.arr[bl->firstgoto]); /* error */ |
691 | } | 691 | } |
692 | } | 692 | } |