aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-04-21 09:47:41 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-04-21 09:47:41 -0700
commita380b803ac8b4eefcde4d3d552cdcbc8010aa798 (patch)
treede6309db31e1614467295bfd82c3bc27928bd27b /src/codegen.cpp
parentae600d2f7f89989c297c036f189b7bedfde910af (diff)
downloadzig-a380b803ac8b4eefcde4d3d552cdcbc8010aa798.tar.gz
zig-a380b803ac8b4eefcde4d3d552cdcbc8010aa798.zip
ability to use a struct with no fields
Diffstat (limited to 'src/codegen.cpp')
-rw-r--r--src/codegen.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp
index 80eb4b2089..8ba76e0cfb 100644
--- a/src/codegen.cpp
+++ b/src/codegen.cpp
@@ -801,14 +801,16 @@ static LLVMValueRef gen_fn_call_expr(CodeGen *g, AstNode *node) {
gen_param_values[gen_param_index] = node->data.fn_call_expr.tmp_ptr;
gen_param_index += 1;
}
- if (struct_type) {
+ if (struct_type && type_has_bits(struct_type)) {
gen_param_values[gen_param_index] = gen_expr(g, first_param_expr);
+ assert(gen_param_values[gen_param_index]);
gen_param_index += 1;
}
for (int i = 0; i < fn_call_param_count; i += 1) {
AstNode *expr_node = node->data.fn_call_expr.params.at(i);
LLVMValueRef param_value = gen_expr(g, expr_node);
+ assert(param_value);
TypeTableEntry *param_type = get_expr_type(expr_node);
if (is_var_args || type_has_bits(param_type)) {
gen_param_values[gen_param_index] = param_value;