Browse Source

Fix predict_next() in parser.

Reported by Sergey Kaplun. #1033
Mike Pall 2 years ago
parent
commit
caf7cbc57c
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/lj_parse.c

+ 1 - 0
src/lj_parse.c

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