From a064156d5de8503d63bba271f1fb5a14c75ca18b Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 13 Dec 2011 18:05:51 +0100 Subject: [PATCH] PPC: Avoid undefined operand dereference in BAND/shift fusion. --- src/lj_asm_ppc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lj_asm_ppc.h b/src/lj_asm_ppc.h index 490ad816..f3f9e2e0 100644 --- a/src/lj_asm_ppc.h +++ b/src/lj_asm_ppc.h @@ -1490,7 +1490,7 @@ static void asm_fuseandsh(ASMState *as, PPCIns pi, int32_t mask, IRRef ref) IRIns *ir; Reg left; if (mayfuse(as, ref) && (ir = IR(ref), ra_noreg(ir->r)) && - irref_isk(ir->op2)) { + irref_isk(ir->op2) && ir->o >= IR_BSHL && ir->o <= IR_BROR) { int32_t sh = (IR(ir->op2)->i & 31); switch (ir->o) { case IR_BSHL: