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/ir.cpp | |
| parent | 482c687462f21d80b2f026cdb870dafcb06bfb88 (diff) | |
Fix #622 on both backends
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 65e565bc5..e2c9f90ed 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -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 && |