aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2023-08-28 21:00:37 +0200
committerMike Pall <mike>2023-08-28 21:00:37 +0200
commit309fb42b871b6414f53e0e0e708bce0b0d62daff (patch)
treef38b61e87527af5ac14ce496959868abec26a2d1
parentd0ce82ecdcf0fcfb766e207eac6b7622680817b2 (diff)
downloadluajit-309fb42b871b6414f53e0e0e708bce0b0d62daff.tar.gz
luajit-309fb42b871b6414f53e0e0e708bce0b0d62daff.tar.bz2
luajit-309fb42b871b6414f53e0e0e708bce0b0d62daff.zip
Fix predict_next() in parser (again).
Reported by Sergey Bronnikov. #1054
-rw-r--r--src/lj_parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lj_parse.c b/src/lj_parse.c
index c0cbd261..afdbcc3d 100644
--- a/src/lj_parse.c
+++ b/src/lj_parse.c
@@ -2527,9 +2527,11 @@ static void parse_for_num(LexState *ls, GCstr *varname, BCLine line)
2527*/ 2527*/
2528static int predict_next(LexState *ls, FuncState *fs, BCPos pc) 2528static int predict_next(LexState *ls, FuncState *fs, BCPos pc)
2529{ 2529{
2530 BCIns ins = fs->bcbase[pc].ins; 2530 BCIns ins;
2531 GCstr *name; 2531 GCstr *name;
2532 cTValue *o; 2532 cTValue *o;
2533 if (pc >= fs->bclim) return 0;
2534 ins = fs->bcbase[pc].ins;
2533 switch (bc_op(ins)) { 2535 switch (bc_op(ins)) {
2534 case BC_MOV: 2536 case BC_MOV:
2535 if (bc_d(ins) >= fs->nactvar) return 0; 2537 if (bc_d(ins) >= fs->nactvar) return 0;