Open TheWaWaR opened 2 years ago
codegen.cpp:4420
:
if (instruction->modifier == CallModifierAsync) {
frame_result_loc = result_loc;
} else {
ir_assert(instruction->frame_result_loc != nullptr, &instruction->base); // <-- assert hit
frame_result_loc_uncasted = ir_llvm_value(g, instruction->frame_result_loc);
ir_assert(instruction->fn_entry != nullptr, &instruction->base);
frame_result_loc = LLVMBuildBitCast(g->builder, frame_result_loc_uncasted,
LLVMPointerType(get_llvm_type(g, instruction->fn_entry->frame_type), 0), "");
}
net.zig:1646
if (std.io.is_async) {
return std.event.Loop.instance.?.write(self.handle, buffer, false); // <--
} else {
return os.write(self.handle, buffer);
}
Zig Version
0.9.0-dev.1980+877a1f2a2
Steps to Reproduce
Save zig code as
try-async-await.zig
Then run follow command in one terminal:
And run follow command in another terminal:
If change the zig code to follow, it just work as expected:
Or, just change
io_mode
to.blocking
will also work just fine.Expected Behavior
Success without output.
Actual Behavior