mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Fix out-of-scope goto handling in parser.
Many thanks to Demetrios Obenour for tracking down this long-standing bug.
This commit is contained in:
parent
3ab9f5a18d
commit
ff648369aa
@ -1280,13 +1280,15 @@ static void fscope_end(FuncState *fs)
|
|||||||
MSize idx = gola_new(ls, NAME_BREAK, VSTACK_LABEL, fs->pc);
|
MSize idx = gola_new(ls, NAME_BREAK, VSTACK_LABEL, fs->pc);
|
||||||
ls->vtop = idx; /* Drop break label immediately. */
|
ls->vtop = idx; /* Drop break label immediately. */
|
||||||
gola_resolve(ls, bl, idx);
|
gola_resolve(ls, bl, idx);
|
||||||
return;
|
} else { /* Need the fixup step to propagate the breaks. */
|
||||||
} /* else: need the fixup step to propagate the breaks. */
|
gola_fixup(ls, bl);
|
||||||
} else if (!(bl->flags & FSCOPE_GOLA)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if ((bl->flags & FSCOPE_GOLA)) {
|
||||||
gola_fixup(ls, bl);
|
gola_fixup(ls, bl);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Mark scope as having an upvalue. */
|
/* Mark scope as having an upvalue. */
|
||||||
static void fscope_uvmark(FuncState *fs, BCReg level)
|
static void fscope_uvmark(FuncState *fs, BCReg level)
|
||||||
|
Loading…
Reference in New Issue
Block a user