diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-07-05 07:55:58 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-07-31 22:21:59 +0200 |
| commit | 8daa5eacec82264bd34232aefe12b5ff885d0b8a (patch) | |
| tree | 5d654a0dfd32a207e2cab91d30382d09d5899c91 /linearize.c | |
| parent | c7dd24480716c2bf853b63d462c3c8be84b78359 (diff) | |
| download | sparse-dev-8daa5eacec82264bd34232aefe12b5ff885d0b8a.tar.gz | |
fix crash when ep->active is NULL
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'linearize.c')
| -rw-r--r-- | linearize.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/linearize.c b/linearize.c index a3672077..12209492 100644 --- a/linearize.c +++ b/linearize.c @@ -820,10 +820,15 @@ static pseudo_t argument_pseudo(struct entrypoint *ep, int nr) pseudo_t alloc_phi(struct basic_block *source, pseudo_t pseudo, int size) { - struct instruction *insn = alloc_instruction(OP_PHISOURCE, size); - pseudo_t phi = __alloc_pseudo(0); + struct instruction *insn; + pseudo_t phi; static int nr = 0; + if (!source) + return VOID; + + insn = alloc_instruction(OP_PHISOURCE, size); + phi = __alloc_pseudo(0); phi->type = PSEUDO_PHI; phi->nr = ++nr; phi->def = insn; |
