lua-hooks/ext/luajit/src/lj_parse.c in immunio-1.2.1 vs lua-hooks/ext/luajit/src/lj_parse.c in immunio-2.0.2

- old
+ new

@@ -1,8 +1,8 @@ /* ** Lua parser (source code -> bytecode). -** Copyright (C) 2005-2016 Mike Pall. See Copyright Notice in luajit.h +** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h ** ** Major portions taken verbatim or adapted from the Lua interpreter. ** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h */ @@ -1280,16 +1280,18 @@ if ((bl->flags & FSCOPE_BREAK)) { if ((bl->flags & FSCOPE_LOOP)) { MSize idx = gola_new(ls, NAME_BREAK, VSTACK_LABEL, fs->pc); ls->vtop = idx; /* Drop break label immediately. */ gola_resolve(ls, bl, idx); + } else { /* Need the fixup step to propagate the breaks. */ + gola_fixup(ls, bl); return; - } /* else: need the fixup step to propagate the breaks. */ - } else if (!(bl->flags & FSCOPE_GOLA)) { - return; + } } - gola_fixup(ls, bl); + if ((bl->flags & FSCOPE_GOLA)) { + gola_fixup(ls, bl); + } } /* Mark scope as having an upvalue. */ static void fscope_uvmark(FuncState *fs, BCReg level) { @@ -2175,10 +2177,12 @@ BCReg reg = fs->freereg; bcreg_reserve(fs, (BCReg)extra); bcemit_nil(fs, reg, (BCReg)extra); } } + if (nexps > nvars) + ls->fs->freereg -= nexps - nvars; /* Drop leftover regs. */ } /* Recursively parse assignment statement. */ static void parse_assignment(LexState *ls, LHSVarList *lh, BCReg nvars) { @@ -2208,11 +2212,9 @@ } bcemit_store(ls->fs, &lh->v, &e); return; } assign_adjust(ls, nvars, nexps, &e); - if (nexps > nvars) - ls->fs->freereg -= nexps - nvars; /* Drop leftover regs. */ } /* Assign RHS to LHS and recurse downwards. */ expr_init(&e, VNONRELOC, ls->fs->freereg-1); bcemit_store(ls->fs, &lh->v, &e); }