diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-03-25 23:17:40 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2018-05-06 01:37:01 +0200 |
| commit | 0f04287d49a9a812064e11f000c6eb51ba417f01 (patch) | |
| tree | dac2fee86e4ae87e614708c6b863fb79e7d63536 | |
| parent | 26688ccf9a4d3b93ce3af58578655b18896226fe (diff) | |
| download | sparse-dev-0f04287d49a9a812064e11f000c6eb51ba417f01.tar.gz | |
fix missing checks for deleted instructions
Instructions with a null ->bb are instructions which have
been killed. As such, they must thus always be ignored.
Fix this by adding the missing checks for null ->bb when
looping over all the instructions of a basic block.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | graph.c | 2 | ||||
| -rw-r--r-- | sparse.c | 2 |
2 files changed, 4 insertions, 0 deletions
@@ -74,6 +74,8 @@ static void graph_ep(struct entrypoint *ep) /* List loads and stores */ FOR_EACH_PTR(bb->insns, insn) { + if (!insn->bb) + continue; switch(insn->opcode) { case OP_STORE: if (insn->symbol->type == PSEUDO_SYM) { @@ -47,6 +47,8 @@ static int context_increase(struct basic_block *bb, int entry) FOR_EACH_PTR(bb->insns, insn) { int val; + if (!insn->bb) + continue; if (insn->opcode != OP_CONTEXT) continue; val = insn->increment; |
