Fix a segfault with switch on an undefined symbol.

Forgot to check if the test expression was not an error.
This commit is contained in:
Bill Currie 2016-01-10 13:41:49 +09:00
parent f163e35f21
commit 932647bad3

View file

@ -405,6 +405,10 @@ switch_expr (switch_block_t *switch_block, expr_t *break_label,
int saved_line = pr.source_line;
string_t saved_file = pr.source_file;
if (switch_block->test->type == ex_error) {
return switch_block->test;
}
pr.source_line = sw_val->line = switch_block->test->line;
pr.source_file = sw_val->file = switch_block->test->file;