Add defer catch/try. Fix missing defer invoked on return a > 0 ? Foo.ABC! : 1

This commit is contained in:
Christoffer Lerno
2023-02-21 20:10:03 +01:00
parent b5a2b5c68a
commit 8f5676b488
12 changed files with 247 additions and 33 deletions

View File

@@ -5532,7 +5532,7 @@ static inline void llvm_emit_return_block(GenContext *c, BEValue *be_value, Type
// Defers? In that case we also use the default behaviour.
// We might optimize this later.
if (value->return_stmt.cleanup) break;
if (value->return_stmt.cleanup || value->return_stmt.cleanup_fail) break;
Expr *ret_expr = value->return_stmt.expr;