diff options
| author | gingerBill <bill@gingerbill.org> | 2020-05-13 23:00:34 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-05-13 23:00:34 +0100 |
| commit | 2630e9ced153ae8806053cf1662d4b4e4fbcfc63 (patch) | |
| tree | b80cc24369f34d4ec0802866f17b96ce5dff5a92 /src/llvm_backend.cpp | |
| parent | 482c687462f21d80b2f026cdb870dafcb06bfb88 (diff) | |
Fix #622 on both backends
Diffstat (limited to 'src/llvm_backend.cpp')
| -rw-r--r-- | src/llvm_backend.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp index 816d81f33..06209a35e 100644 --- a/src/llvm_backend.cpp +++ b/src/llvm_backend.cpp @@ -6432,6 +6432,11 @@ void lb_build_defer_stmt(lbProcedure *p, lbDefer d) { return; } + isize prev_context_stack_count = p->context_stack.count; + defer (p->context_stack.count = prev_context_stack_count); + p->context_stack.count = d.context_stack_count; + + lbBlock *b = lb_create_block(p, "defer"); if (last_instr == nullptr || !LLVMIsATerminatorInst(last_instr)) { lb_emit_jump(p, b); |