diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-03-10 01:12:22 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-03-10 01:38:40 -0500 |
| commit | 84e952c230ddb9c2bd232958010d2045384532eb (patch) | |
| tree | 23e153f531fd723e19314320fb87424301d92f21 /src/codegen.cpp | |
| parent | 3b3649b86f74d08013b669a6a4eac573f8d7fa23 (diff) | |
| download | zig-84e952c230ddb9c2bd232958010d2045384532eb.tar.gz zig-84e952c230ddb9c2bd232958010d2045384532eb.zip | |
fix await multithreaded data race
coro return was reading from a value that coro await was
writing to. that wasn't how it was designed to work, it
was an implementation mistake.
this commit also has some work-in-progress code for fixing
error return traces across suspend points.
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index f4275243c3..384322dac1 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -4251,6 +4251,7 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable, case IrInstructionIdExport: case IrInstructionIdErrorUnion: case IrInstructionIdPromiseResultType: + case IrInstructionIdAwaitBookkeeping: zig_unreachable(); case IrInstructionIdReturn: @@ -5279,7 +5280,7 @@ static void do_code_gen(CodeGen *g) { uint32_t err_ret_trace_arg_index = get_err_ret_trace_arg_index(g, fn_table_entry); if (err_ret_trace_arg_index != UINT32_MAX) { g->cur_err_ret_trace_val = LLVMGetParam(fn, err_ret_trace_arg_index); - } else if (g->have_err_ret_tracing && fn_table_entry->calls_errorable_function) { + } else if (g->have_err_ret_tracing && fn_table_entry->calls_or_awaits_errorable_fn) { // TODO call graph analysis to find out what this number needs to be for every function static const size_t stack_trace_ptr_count = 30; |
