diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-02-16 01:32:15 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-02-16 01:44:52 -0500 |
| commit | 7f7d1fbe5ad16fd41eeaeb20e3e71a39bdd3f991 (patch) | |
| tree | 1c726145e8b301beb25ab781ab9e06d27c146797 /src/codegen.cpp | |
| parent | cb3a818699649a985d5879151936b3b88ffddfa4 (diff) | |
| download | zig-7f7d1fbe5ad16fd41eeaeb20e3e71a39bdd3f991.tar.gz zig-7f7d1fbe5ad16fd41eeaeb20e3e71a39bdd3f991.zip | |
Implement noasync awaits
Note that there is not yet runtime safety for this.
See #3157
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 0f6988f986..a0bc56f093 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -6188,7 +6188,9 @@ static LLVMValueRef ir_render_await(CodeGen *g, IrExecutableGen *executable, IrI LLVMValueRef result_loc = (instruction->result_loc == nullptr) ? nullptr : ir_llvm_value(g, instruction->result_loc); - if (instruction->target_fn != nullptr && !fn_is_async(instruction->target_fn)) { + if (instruction->is_noasync || + (instruction->target_fn != nullptr && !fn_is_async(instruction->target_fn))) + { return gen_await_early_return(g, &instruction->base, target_frame_ptr, result_type, ptr_result_type, result_loc, true); } |
