mirror of
https://github.com/ziglang/zig.git
synced 2026-01-12 10:25:13 +00:00
add compile error for unable to determine async fn frame
This commit is contained in:
parent
8d4cb85285
commit
8be95af480
@ -31,3 +31,8 @@
|
||||
* grep for "coroutine" and "coro" and replace all that nomenclature with "async functions"
|
||||
* when there are multiple calls to async functions in a function, reuse the same frame buffer, so that the
|
||||
needed bytes is equal to the largest callee's frame
|
||||
* if an async function is never called with async then a few optimizations can be made:
|
||||
- the return does not need to be atomic
|
||||
- it can be assumed that these are always available: the awaiter ptr, return ptr if applicable,
|
||||
error return trace ptr if applicable.
|
||||
- it can be assumed that it is never cancelled
|
||||
|
||||
@ -5198,6 +5198,13 @@ static Error resolve_coro_frame(CodeGen *g, ZigType *frame_type) {
|
||||
if (callee->body_node == nullptr) {
|
||||
continue;
|
||||
}
|
||||
if (callee->anal_state == FnAnalStateProbing) {
|
||||
ErrorMsg *msg = add_node_error(g, fn->proto_node,
|
||||
buf_sprintf("unable to determine async function frame of '%s'", buf_ptr(&fn->symbol_name)));
|
||||
add_error_note(g, msg, call->base.source_node,
|
||||
buf_sprintf("analysis of function '%s' depends on the frame", buf_ptr(&callee->symbol_name)));
|
||||
return ErrorSemanticAnalyzeFail;
|
||||
}
|
||||
|
||||
analyze_fn_body(g, callee);
|
||||
if (callee->anal_state == FnAnalStateInvalid) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user