diff mbox series

fix kill_insn(OP_SETVAL)

Message ID 20201121171629.93454-1-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show
Series fix kill_insn(OP_SETVAL) | expand

Commit Message

Luc Van Oostenryck Nov. 21, 2020, 5:16 p.m. UTC
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>
---
 simplify.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/simplify.c b/simplify.c
index a0e23d6de01f..4d0adf444e17 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;
 	}