From b3459f64e795118c4c12890ed0fec75638b74a2c Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 1 Feb 2016 02:00:25 -0700 Subject: parseh understands macros which alias global fn ptr vars --- src/codegen.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index a5374eb2de..ef910bbba7 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -612,6 +612,8 @@ static LLVMValueRef gen_fn_call_expr(CodeGen *g, AstNode *node) { return LLVMBuildUnreachable(g->builder); } else if (first_arg_ret) { return node->data.fn_call_expr.tmp_ptr; + } else if (src_return_type->size_in_bits == 0) { + return nullptr; } else { return result; } @@ -2767,6 +2769,7 @@ static void do_code_gen(CodeGen *g) { } VariableTableEntry *variable = param_decl->data.param_decl.variable; + assert(variable); LLVMZigDILocation *debug_loc = LLVMZigGetDebugLoc(param_decl->line + 1, param_decl->column + 1, fn_def_node->data.fn_def.block_context->di_scope); -- cgit v1.2.3