X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast2firm.c;h=a7d60dd7346864eb3a592786b20736ddac5d3342;hb=99ae9203c924c96590375ffb7791dd77a75804d1;hp=6cfec8851ffad630ae1aa16512619cff015cb537;hpb=412c51608d8f10f52bdb46a68e6ccd0915a39f00;p=cparser diff --git a/ast2firm.c b/ast2firm.c index 6cfec88..a7d60dd 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -5248,11 +5248,14 @@ static void case_label_to_firm(const case_label_statement_t *statement) dbg_info *dbgi = get_dbg_info(&statement->base.source_position); - ir_node *const fallthrough = (get_cur_block() == NULL ? NULL : new_Jmp()); - ir_node *proj; ir_node *block = new_immBlock(); + if (get_cur_block() != NULL) { + /* Fallthrough from previous case */ + add_immBlock_pred(block, new_Jmp()); + } + if (current_switch_cond != NULL) { set_cur_block(get_nodes_block(current_switch_cond)); if (statement->expression != NULL) { @@ -5273,9 +5276,6 @@ static void case_label_to_firm(const case_label_statement_t *statement) } } - if (fallthrough != NULL) { - add_immBlock_pred(block, fallthrough); - } mature_immBlock(block); set_cur_block(block);