aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-01-31 16:04:26 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-01-31 16:04:26 -0500
commitd13cec6894aa01b6a5dbf6a7cf9b071fa9c68666 (patch)
tree3bf96fabf7d9df63ee9cc463ebd8c96207f8af23 /src/ir.cpp
parent88a253c64dc148a6f09e4e872e3abbcd37fcc18a (diff)
downloadzig-d13cec6894aa01b6a5dbf6a7cf9b071fa9c68666.tar.gz
zig-d13cec6894aa01b6a5dbf6a7cf9b071fa9c68666.zip
fix var args allocating wrong amount of memory in compiler
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 48782ba907..ed4382d415 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -7866,7 +7866,7 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal
impl_fn->fndef_scope = create_fndef_scope(impl_fn->fn_def_node, parent_scope, impl_fn);
impl_fn->child_scope = &impl_fn->fndef_scope->base;
FnTypeId inst_fn_type_id = {0};
- init_fn_type_id(&inst_fn_type_id, fn_proto_node);
+ init_fn_type_id(&inst_fn_type_id, fn_proto_node, call_param_count);
inst_fn_type_id.param_count = 0;
inst_fn_type_id.is_var_args = false;
@@ -7875,7 +7875,7 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal
GenericFnTypeId *generic_id = allocate<GenericFnTypeId>(1);
generic_id->fn_entry = fn_entry;
generic_id->param_count = 0;
- generic_id->params = allocate<ConstExprValue>(src_param_count);
+ generic_id->params = allocate<ConstExprValue>(call_param_count);
size_t next_proto_i = 0;
if (first_arg_ptr) {
@@ -11483,7 +11483,7 @@ static TypeTableEntry *ir_analyze_instruction_fn_proto(IrAnalyze *ira, IrInstruc
assert(proto_node->type == NodeTypeFnProto);
FnTypeId fn_type_id = {0};
- init_fn_type_id(&fn_type_id, proto_node);
+ init_fn_type_id(&fn_type_id, proto_node, proto_node->data.fn_proto.params.length);
bool depends_on_compile_var = false;