diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c index 84c5dc00..9c00f7e7 100644 --- a/src/lj_opt_fold.c +++ b/src/lj_opt_fold.c @@ -1858,7 +1858,8 @@ LJFOLDF(abc_k) LJFOLD(ABC any any) LJFOLDF(abc_invar) { - if (!irt_isint(fins->t) && J->chain[IR_LOOP]) /* Currently marked as PTR. */ + /* Invariant ABC marked as PTR. Drop if op1 is invariant, too. */ + if (!irt_isint(fins->t) && fins->op1 < J->chain[IR_LOOP]) return DROPFOLD; return NEXTFOLD; }