Don't create default_expr unless needed.

The goto for the default expression is the source of the mis-counted label
users: the label was being counted by the goto, but the goto was never
being inserted into the code (only v6 progs or "difficult" types insert the
goto).
This commit is contained in:
Bill Currie 2012-11-24 21:53:00 +09:00
parent d0e56c91cc
commit f6e5428382

View file

@ -395,7 +395,6 @@ switch_expr (switch_block_t *switch_block, expr_t *break_label,
default_label = &_default_label;
default_label->label = break_label;
}
default_expr = goto_expr (default_label->label);
append_expr (sw, assign_expr (sw_val, switch_block->test));
@ -412,6 +411,7 @@ switch_expr (switch_block_t *switch_block, expr_t *break_label,
append_expr (sw, test);
}
default_expr = goto_expr (default_label->label);
append_expr (sw, default_expr);
} else {
expr_t *temp;