fix default proj getting constructed in wrong block
authorMatthias Braun <matze@braunis.de>
Fri, 19 Jun 2009 15:12:58 +0000 (15:12 +0000)
committerMatthias Braun <matze@braunis.de>
Fri, 19 Jun 2009 15:12:58 +0000 (15:12 +0000)
[r26165]

ast2firm.c

index eb8dd33..510d293 100644 (file)
@@ -4987,12 +4987,14 @@ static ir_node *get_break_label(void)
 
 static void switch_statement_to_firm(switch_statement_t *statement)
 {
-       ir_node  *first_block = get_cur_block();
+       ir_node  *first_block = NULL;
        dbg_info *dbgi        = get_dbg_info(&statement->base.source_position);
        ir_node  *cond        = NULL;
-       if (first_block != NULL) {
+
+       if (get_cur_block() != NULL) {
                ir_node *expression = expression_to_firm(statement->expression);
                cond                = new_d_Cond(dbgi, expression);
+               first_block         = get_cur_block();
        }
 
        set_cur_block(NULL);