Do not crash, when the body of an switch statement is empty.
authorChristoph Mallon <christoph.mallon@gmx.de>
Fri, 14 Dec 2007 09:50:38 +0000 (09:50 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Fri, 14 Dec 2007 09:50:38 +0000 (09:50 +0000)
[r18739]

ast2firm.c

index ac69667..c9a1d8c 100644 (file)
@@ -3386,7 +3386,9 @@ static void switch_statement_to_firm(const switch_statement_t *statement)
        current_switch_cond                  = cond;
        break_label                          = break_block;
 
-       statement_to_firm(statement->body);
+       if (statement->body != NULL) {
+               statement_to_firm(statement->body);
+       }
 
        if(get_cur_block() != NULL) {
                ir_node *jmp = new_Jmp();