aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-25 18:39:14 +0200
committerlemon <lsof@mailbox.org>2022-08-25 18:39:14 +0200
commit76d1180de688192d73f52c04b99c213903557601 (patch)
treef106facdf65f61f8f61ba7916b13d8f671173fdd /src
parentb89330259432de90578f21b013bae78177a1221c (diff)
don't inherit defers into nested functions
Diffstat (limited to 'src')
-rw-r--r--src/parse.cff3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parse.cff b/src/parse.cff
index 3512c96..e1b5f58 100644
--- a/src/parse.cff
+++ b/src/parse.cff
@@ -2610,7 +2610,10 @@ fn parsefn(P *Parser, loc Loc, toplevel bool, externp bool, name *const u8) *Dec
}
}
with_tmpchange(P.alloc, &Allocator { &Arena {}, &Arena:allocf }) {
+ let block = P.curblock;
+ P.curblock = #null;
Fn.body = :Some(parseblock(P));
+ P.curblock = block;
popenv(P);
// ir_genfn(P.irctx, Fn);
llvm_genfn(externp, name, Fn);