aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-02-08 14:59:33 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-02-08 14:59:33 -0500
commit80ba21b83cd13849c1d1d9cdebfa070b03f334d3 (patch)
treec4138d82ba6485317fb025886c33bc7cb5bc5605 /src/analyze.cpp
parent884804dbc3a066fde06da769994554efe09febd6 (diff)
downloadzig-80ba21b83cd13849c1d1d9cdebfa070b03f334d3.tar.gz
zig-80ba21b83cd13849c1d1d9cdebfa070b03f334d3.zip
properly spill optional payload capture value
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 70352a2c18..e5b90aa7b1 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -6104,11 +6104,12 @@ static void mark_suspension_point(Scope *scope) {
continue;
}
case ScopeIdExpr: {
+ ScopeExpr *parent_expr_scope = reinterpret_cast<ScopeExpr *>(scope);
if (!looking_for_exprs) {
+ parent_expr_scope->need_spill = MemoizedBoolTrue;
// Now we're only looking for a block, to see if it's in a loop (see the case ScopeIdBlock)
continue;
}
- ScopeExpr *parent_expr_scope = reinterpret_cast<ScopeExpr *>(scope);
if (child_expr_scope != nullptr) {
for (size_t i = 0; parent_expr_scope->children_ptr[i] != child_expr_scope; i += 1) {
assert(i < parent_expr_scope->children_len);