summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2016-07-28 08:43:43 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2016-07-28 08:44:28 +0200
commitb7050b73d410e6d7071fe8c4a6f5e9ab1e47fdeb (patch)
treebc75352dfb760b6a44d804957aff2bb34976a14f /src
parentee9ae7f96569d31f4fee41dcf5071160b0d35e76 (diff)
Handle definitely leaving a compound expression.
This fixes stmt_expr_goto.c.
Diffstat (limited to 'src')
-rw-r--r--src/firm/ast2firm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/firm/ast2firm.c b/src/firm/ast2firm.c
index 362ab2b..28785fc 100644
--- a/src/firm/ast2firm.c
+++ b/src/firm/ast2firm.c
@@ -2175,7 +2175,14 @@ static ir_node *statement_expression_to_firm(const statement_expression_t *expr)
statement_t *statement = expr->statement;
assert(statement->kind == STATEMENT_COMPOUND);
- return compound_statement_to_firm(&statement->compound);
+ ir_node *res = compound_statement_to_firm(&statement->compound);
+ if (!currently_reachable()) {
+ set_soft_unreachable();
+ type_t *const type = skip_typeref(expr->base.type);
+ if (!is_type_void(type))
+ res = new_Bad(get_ir_mode_arithmetic(type));
+ }
+ return res;
}
static ir_node *va_start_expression_to_firm(const va_start_expression_t *const expr)