aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-21 17:46:50 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-21 17:47:34 +0100
commit641cf2c295285ee15f35dbcfd85367ca61259be0 (patch)
treec6decf8ca1df56afa93f1ef61eb83537cc6ead63
parentb59dbdaf37400cc57e21f8b4bc72a8092d0a2332 (diff)
downloadsparse-641cf2c295285ee15f35dbcfd85367ca61259be0.tar.gz
fix kill_insn(OP_SETVAL)
When killing OP_SETVAL's, kill_use(&insn->src1) is called to remove the usage of its first operand but OP_SETVAL has no such operand. Fix this by moving the corresponding entry with OP_SETFVAL and others instruction without operands. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--simplify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/simplify.c b/simplify.c
index a0e23d6d..4d0adf44 100644
--- a/simplify.c
+++ b/simplify.c
@@ -325,7 +325,6 @@ int kill_insn(struct instruction *insn, int force)
/* fall through */
case OP_UNOP ... OP_UNOP_END:
- case OP_SETVAL:
case OP_SLICE:
kill_use(&insn->src1);
break;
@@ -380,6 +379,7 @@ int kill_insn(struct instruction *insn, int force)
case OP_BR:
case OP_SETFVAL:
+ case OP_SETVAL:
default:
break;
}