aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-03-24 22:05:29 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-03-24 22:07:12 -0400
commitaa2995ee395b2c1329a61513debcac6225fcb8a8 (patch)
treeb96e44da1d55ee671538c775ca5aeb9d91f2c0a7 /src/analyze.cpp
parenta43c7af3d1e41ccee73678f114bb3844febcaad6 (diff)
downloadzig-aa2995ee395b2c1329a61513debcac6225fcb8a8.tar.gz
zig-aa2995ee395b2c1329a61513debcac6225fcb8a8.zip
fix invalid codegen for error return traces across suspend points
See #821 Now the code works correctly, but error return traces are missing the frames from coroutines.
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 0f4728f822..7ee1de78a2 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -170,6 +170,12 @@ Scope *create_comptime_scope(AstNode *node, Scope *parent) {
return &scope->base;
}
+Scope *create_coro_prelude_scope(AstNode *node, Scope *parent) {
+ ScopeCoroPrelude *scope = allocate<ScopeCoroPrelude>(1);
+ init_scope(&scope->base, ScopeIdCoroPrelude, node, parent);
+ return &scope->base;
+}
+
ImportTableEntry *get_scope_import(Scope *scope) {
while (scope) {
if (scope->id == ScopeIdDecls) {
@@ -3592,6 +3598,7 @@ FnTableEntry *scope_get_fn_if_root(Scope *scope) {
case ScopeIdCImport:
case ScopeIdLoop:
case ScopeIdCompTime:
+ case ScopeIdCoroPrelude:
scope = scope->parent;
continue;
case ScopeIdFnDef: