diff options
| -rw-r--r-- | linearize.c | 11 | ||||
| -rw-r--r-- | validation/linear/unreachable-label0.c | 1 |
2 files changed, 6 insertions, 6 deletions
diff --git a/linearize.c b/linearize.c index a56c272f..3e7d4d9e 100644 --- a/linearize.c +++ b/linearize.c @@ -2177,13 +2177,14 @@ static pseudo_t linearize_switch(struct entrypoint *ep, struct statement *stmt) struct multijmp *jmp; pseudo_t pseudo; + if (!expr || !expr->ctype) + return VOID; pseudo = linearize_expression(ep, expr); - if (pseudo == VOID) - return pseudo; - active = ep->active; - if (!bb_reachable(active)) - return VOID; + if (!active) { + active = alloc_basic_block(ep, stmt->pos); + set_activeblock(ep, active); + } switch_ins = alloc_typed_instruction(OP_SWITCH, expr->ctype); use_pseudo(switch_ins, pseudo, &switch_ins->cond); diff --git a/validation/linear/unreachable-label0.c b/validation/linear/unreachable-label0.c index 568ae588..695e5cb0 100644 --- a/validation/linear/unreachable-label0.c +++ b/validation/linear/unreachable-label0.c @@ -12,7 +12,6 @@ label: /* * check-name: unreachable-label0 * check-command: test-linearize $file - * check-known-to-fail * * check-output-ignore * check-output-contains: ret\\. |
