Skip to contentSkip to conversation

fix missing itype in SEL(x, 0/1, 1/0) --> (x ==/!= 0)

PATCH New Luc Van Oostenryck 1 participant 1 message Jul 29, 2021 Sparse checker

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix missing itype in SEL(x, 0/1, 1/0) --> (x ==/!= 0)

From: Luc Van Oostenryck <[email protected]>

Since commit 226b62bc2ee4 ("eval_insn: give an explicit type to compare's operands") it's needed to set the operands' type of every compare instructions but it was missing in this case where a select is transformed into a compare.

So, add the missing type.

---
 simplify.c | 1 +
 1 file changed, 1 insertion(+)
simplify.c +1 -0
index 02709ce4853c..0353642ba188 100644
@@ -2449,6 +2449,7 @@ static int simplify_select(struct instruction *insn)
 				opcode = OP_SET_NE;
 			}
 			insn->opcode = opcode;
+			insn->itype = insn->type;
 			/* insn->src1 is already cond */
 			insn->src2 = src1; /* Zero */
 			return REPEAT_CSE;
Signature · 1 line
2.32.0