aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-08-15 15:06:05 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-08-15 15:06:05 -0400
commit55f5cee86b39bb2127a316f9b5d0abf532580cac (patch)
treea9bce15a8899632cf527b980c8fc27280bd9dca0 /src/analyze.cpp
parent13b5a4bf8ca65c569e6b28ca0e41d101d12d0ff1 (diff)
downloadzig-55f5cee86b39bb2127a316f9b5d0abf532580cac.tar.gz
zig-55f5cee86b39bb2127a316f9b5d0abf532580cac.zip
fix error return traces for async calls of blocking functions
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index fc42abaf26..21289f24a8 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -3819,6 +3819,11 @@ static void add_async_error_notes(CodeGen *g, ErrorMsg *msg, ZigFn *fn) {
} else if (fn->inferred_async_node->type == NodeTypeAwaitExpr) {
add_error_note(g, msg, fn->inferred_async_node,
buf_sprintf("await is a suspend point"));
+ } else if (fn->inferred_async_node->type == NodeTypeFnCallExpr &&
+ fn->inferred_async_node->data.fn_call_expr.is_builtin)
+ {
+ add_error_note(g, msg, fn->inferred_async_node,
+ buf_sprintf("@frame() causes function to be async"));
} else {
add_error_note(g, msg, fn->inferred_async_node,
buf_sprintf("suspends here"));