From 5266289d39f4295906e26c5e036577b7eb09b0c2 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 25 Jun 2008 08:32:01 +0000 Subject: [PATCH] fix do_while [r20253] --- ast2firm.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ast2firm.c b/ast2firm.c index d05e76d..97814fc 100644 --- a/ast2firm.c +++ b/ast2firm.c @@ -4149,21 +4149,17 @@ static void do_while_statement_to_firm(do_while_statement_t *statement) add_immBlock_pred(body_block, jmp); } - ir_node *false_block = NULL; - - if (statement->body != NULL) { - ir_node *old_continue_label = continue_label; - ir_node *old_break_label = break_label; - continue_label = header_block; - break_label = false_block; + ir_node *old_continue_label = continue_label; + ir_node *old_break_label = break_label; + continue_label = header_block; + break_label = NULL; - statement_to_firm(statement->body); - false_block = break_label; + statement_to_firm(statement->body); + ir_node *false_block = break_label; - assert(continue_label == header_block); - continue_label = old_continue_label; - break_label = old_break_label; - } + assert(continue_label == header_block); + continue_label = old_continue_label; + break_label = old_break_label; if (get_cur_block() != NULL) { ir_node *body_jmp = new_Jmp(); @@ -4171,6 +4167,10 @@ static void do_while_statement_to_firm(do_while_statement_t *statement) mature_immBlock(header_block); } + if (false_block == NULL) { + false_block = new_immBlock(); + } + /* create the condition */ set_cur_block(header_block); -- 2.20.1