Fix #622 on both backends

This commit is contained in:
gingerBill
2020-05-13 23:00:34 +01:00
parent 482c687462
commit 2630e9ced1
2 changed files with 8 additions and 4 deletions
+5
View File
@@ -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);