X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ast2firm.c;h=ab7516b6a72ee56a24c0ab84b6c5044b78c209c2;hb=1c4280092863759931f2fd0753bee70c2f540808;hp=eb8dd33441cd338920a1f97571c8cee7d0daa987;hpb=d8d9d28c9096135af9633a6d1ff23845752f4588;p=cparser diff --git a/ast2firm.c b/ast2firm.c index eb8dd33..ab7516b 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -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); @@ -5569,7 +5571,7 @@ static void initialize_function_parameters(entity_t *entity) if (entity->function.need_closure) { /* add an extra parameter for the static link */ - entity->function.static_link = new_r_Proj(irg, start_block, args, mode_P_data, 0); + entity->function.static_link = new_r_Proj(start_block, args, mode_P_data, 0); ++first_param_nr; } @@ -5603,7 +5605,7 @@ static void initialize_function_parameters(entity_t *entity) ir_mode *param_mode = get_type_mode(param_irtype); long pn = n + first_param_nr; - ir_node *value = new_r_Proj(irg, start_block, args, param_mode, pn); + ir_node *value = new_r_Proj(start_block, args, param_mode, pn); ir_mode *mode = get_ir_mode_storage(type); value = create_conv(NULL, value, mode);