diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ir.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 79f4a27914..c7c9c6490c 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -8346,7 +8346,7 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal } bool found_first_var_arg = false; - size_t first_var_arg = inst_fn_type_id.param_count; + size_t first_var_arg; FnTableEntry *parent_fn_entry = exec_fn_entry(ira->new_irb.exec); assert(parent_fn_entry); @@ -8394,6 +8394,10 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal AstNode *param_decl_node = fn_proto_node->data.fn_proto.params.at(next_proto_i); Buf *param_name = param_decl_node->data.param_decl.name; + if (!found_first_var_arg) { + first_var_arg = inst_fn_type_id.param_count; + } + ConstExprValue *var_args_val = create_const_arg_tuple(ira->codegen, first_var_arg, inst_fn_type_id.param_count); VariableTableEntry *var = add_variable(ira->codegen, param_decl_node, |
