diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-08-31 18:50:16 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-08-31 18:50:16 -0400 |
| commit | 5c3a9a1a3eef82ffad17bc295da05ecccd9006a5 (patch) | |
| tree | bc59e5a8e4526a1d1fa7b8dad10af509a6286419 /src/analyze.cpp | |
| parent | a2230639232c069e4052a2e994dd5c0bd4e2517f (diff) | |
| download | zig-5c3a9a1a3eef82ffad17bc295da05ecccd9006a5.tar.gz zig-5c3a9a1a3eef82ffad17bc295da05ecccd9006a5.zip | |
improvements to `@asyncCall`
* `await @asyncCall` generates better code. See #3065
* `@asyncCall` works with a real `@Frame(func)` in addition to
a byte slice. Closes #3072
* `@asyncCall` allows passing `{}` (a void value) as the result
pointer, which uses the result location inside the frame.
Closes #3068
* support `await @asyncCall` on a non-async function. This is in
preparation for safe recursion (#1006).
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index df5b27784a..dfdf06aa5a 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -5727,6 +5727,10 @@ static Error resolve_async_frame(CodeGen *g, ZigType *frame_type) { for (size_t i = 0; i < fn->call_list.length; i += 1) { IrInstructionCallGen *call = fn->call_list.at(i); + if (call->new_stack != nullptr) { + // don't need to allocate a frame for this + continue; + } ZigFn *callee = call->fn_entry; if (callee == nullptr) { add_node_error(g, call->base.source_node, |
