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

View File

@@ -3307,10 +3307,9 @@ void ir_emit_defer_stmts(irProcedure *proc, irDeferExitKind kind, irBlock *block
while (i --> 0) {
irDefer d = proc->defer_stmts[i];
// TODO(bill, 2020-03-05): Why was this added?
// if (proc->context_stack.count >= d.context_stack_count) {
// proc->context_stack.count = d.context_stack_count;
// }
isize prev_context_stack_count = proc->context_stack.count;
defer (proc->context_stack.count = prev_context_stack_count);
proc->context_stack.count = d.context_stack_count;
if (kind == irDeferExit_Default) {
if (proc->scope_index == d.scope_index &&