aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkristopher tate <kt@connectfree.co.jp>2018-07-28 14:13:26 +0900
committerkristopher tate <kt@connectfree.co.jp>2018-08-02 16:50:08 +0900
commit81f463626ad09dd09e525cda140fb63baf11bc73 (patch)
tree9f89ef5f7a6b5e832ce283d2b79e4b0ca19867d5 /src
parenta2e5691228c61e5c56220fc8f5f72e47b0611000 (diff)
downloadzig-81f463626ad09dd09e525cda140fb63baf11bc73.tar.gz
zig-81f463626ad09dd09e525cda140fb63baf11bc73.zip
src/codegen.cpp: add/throw error for @handle() in a non async context;
Tracking Issue #1296 ; I removed/commented-out the assert checking for no errors since we now have some errors rendered.
Diffstat (limited to 'src')
-rw-r--r--src/codegen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index cbd1955839..43e2a0b694 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -4154,6 +4154,7 @@ static LLVMValueRef ir_render_handle(CodeGen *g, IrExecutable *executable,
executable->fn_entry->type_entry->data.fn.fn_type_id.cc == CallingConventionAsync;
if (!is_async || !executable->coro_handle) {
+ add_node_error(g, instruction->base.source_node, buf_sprintf("@handle() in non-async function"));
return LLVMConstNull(g->builtin_types.entry_promise->type_ref);
}
@@ -6022,7 +6023,8 @@ static void do_code_gen(CodeGen *g) {
ir_render(g, fn_table_entry);
}
- assert(!g->errors.length);
+
+ //assert(!g->errors.length);
if (buf_len(&g->global_asm) != 0) {
LLVMSetModuleInlineAsm(g->module, buf_ptr(&g->global_asm));