aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-01-29 11:48:01 +0100
committerChristopher Li <sparse@chrisli.org>2017-02-13 09:34:45 +0800
commitb5e06b1c455c544e43dbe14badbef0fd07687d64 (patch)
treec87a8c60b032ad362ac79d6d26b69c9884b02f9b
parent9cc8f66242b401b60dff799034384f6bd76fbff3 (diff)
downloadsparse-dev-b5e06b1c455c544e43dbe14badbef0fd07687d64.tar.gz
fix crash while testing between conditional & unconditional OP_BR
It seems that testing for a NULL insn->cond is not the right test, what must be done is to test if either of ->bb_{true,false} is NULL. Fixes: 556dbc8d75 ("Update usage chain for dead instructions") Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Signed-off-by: Christopher Li <sparse@chrisli.org>
-rw-r--r--simplify.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/simplify.c b/simplify.c
index b5cd0ea7..3dea03b5 100644
--- a/simplify.c
+++ b/simplify.c
@@ -221,7 +221,7 @@ void kill_instruction(struct instruction *insn)
case OP_BR:
insn->bb = NULL;
repeat_phase |= REPEAT_CSE;
- if (insn->cond)
+ if (insn->bb_true && insn->bb_false)
kill_use(&insn->cond);
return;
}