aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-07-27 00:23:32 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2021-07-27 00:23:32 +0200
commit9980026aa50cd1b0971d217575a77e92834b3fc1 (patch)
tree23703ff0b44b66868846f3d8a0f68481469e0e8e
parent8af2432923486c753ab52cae70b94ee684121080 (diff)
downloadsparse-9980026aa50cd1b0971d217575a77e92834b3fc1.tar.gz
fix missing itype in SEL(x, 0/1, 1/0) --> (x ==/!= 0)
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. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--simplify.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/simplify.c b/simplify.c
index 02709ce4..0353642b 100644
--- a/simplify.c
+++ b/simplify.c
@@ -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;