Fix predict_next() in parser.

Reported by Sergey Kaplun. #1033
This commit is contained in:
Mike Pall 2023-08-12 16:21:41 +02:00
parent aa2db7ebd1
commit caf7cbc57c

View File

@ -2532,6 +2532,7 @@ static int predict_next(LexState *ls, FuncState *fs, BCPos pc)
cTValue *o; cTValue *o;
switch (bc_op(ins)) { switch (bc_op(ins)) {
case BC_MOV: case BC_MOV:
if (bc_d(ins) >= fs->nactvar) return 0;
name = gco2str(gcref(var_get(ls, fs, bc_d(ins)).name)); name = gco2str(gcref(var_get(ls, fs, bc_d(ins)).name));
break; break;
case BC_UGET: case BC_UGET: