From 12924477a50d37bf055fd5fc1cdf0fd77684a472 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 3 Aug 2019 20:33:16 -0400 Subject: [PATCH] fix regression in calling extern functions --- BRANCH_TODO | 8 ++++---- src/analyze.cpp | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/BRANCH_TODO b/BRANCH_TODO index 0ac1062b43..62fee38371 100644 --- a/BRANCH_TODO +++ b/BRANCH_TODO @@ -1,13 +1,13 @@ - * @asyncCall with an async function pointer + * suspension points inside branching control flow + * go over the commented out tests + * error return tracing * compile error for error: expected anyframe->T, found 'anyframe' * compile error for error: expected anyframe->T, found 'i32' * await of a non async function * async call on a non async function * cancel * defer and errdefer - * safety for double await * implicit cast of normal function to async function should be allowed when it is inferred to be async - * go over the commented out tests * revive std.event.Loop * @typeInfo for @Frame(func) * peer type resolution of *@Frame(func) and anyframe @@ -15,7 +15,6 @@ * returning a value from within a suspend block * make resuming inside a suspend block, with nothing after it, a must-tail call. * make sure there are safety tests for all the new safety features (search the new PanicFnId enum values) - * error return tracing * compile error for casting a function to a non-async function pointer, but then later it gets inferred to be an async function * compile error for copying a frame * compile error for resuming a const frame pointer @@ -33,3 +32,4 @@ - suspend - resume - anyframe, anyframe->T + * safety for double await diff --git a/src/analyze.cpp b/src/analyze.cpp index cd8f981ff3..009cb2de12 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -5182,6 +5182,9 @@ static Error resolve_coro_frame(CodeGen *g, ZigType *frame_type) { buf_sprintf("function is not comptime-known; @asyncCall required")); return ErrorSemanticAnalyzeFail; } + if (callee->body_node == nullptr) { + continue; + } analyze_fn_body(g, callee); if (callee->anal_state == FnAnalStateInvalid) {