mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
ability to use a struct with no fields
This commit is contained in:
1 parent
ae600d2f7f
commit
a380b803ac
3 files changed
+15
-2
No files matched your search
+3
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user