From: Mike Pall Date: Thu, 13 Jan 2022 13:40:11 +0000 (+0100) Subject: Fix ABC FOLD rule with constants. X-Git-Tag: v2.1.ROLLING~105^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8bcf1e5fb8eb72c7e35604fdfd27bba512761bb;p=thirdparty%2FLuaJIT.git Fix ABC FOLD rule with constants. Reported by XmiliaH. --- diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c index 6bb3fc59..1723af60 100644 --- a/src/lj_opt_fold.c +++ b/src/lj_opt_fold.c @@ -1682,14 +1682,15 @@ LJFOLDF(abc_fwd) LJFOLD(ABC any KINT) LJFOLDF(abc_k) { + PHIBARRIER(fleft); if (LJ_LIKELY(J->flags & JIT_F_OPT_ABC)) { IRRef ref = J->chain[IR_ABC]; IRRef asize = fins->op1; while (ref > asize) { IRIns *ir = IR(ref); if (ir->op1 == asize && irref_isk(ir->op2)) { - int32_t k = IR(ir->op2)->i; - if (fright->i > k) + uint32_t k = (uint32_t)IR(ir->op2)->i; + if ((uint32_t)fright->i > k) ir->op2 = fins->op2; return DROPFOLD; }