| author | |
| committer | |
| log | d13cec6894aa01b6a5dbf6a7cf9b071fa9c68666 |
| tree | 3bf96fabf7d9df63ee9cc463ebd8c96207f8af23 |
| parent | 88a253c64dc148a6f09e4e872e3abbcd37fcc18a |
3 files changed, 7 insertions(+), 7 deletions(-)
src/analyze.cpp+3-3| ... | ... | @@ -898,7 +898,7 @@ static TypeTableEntry *get_generic_fn_type(CodeGen *g, FnTypeId *fn_type_id) { |
| 898 | 898 | return fn_type; |
| 899 | 899 | } |
| 900 | 900 | |
| 901 | void init_fn_type_id(FnTypeId *fn_type_id, AstNode *proto_node) { | |
| 901 | void init_fn_type_id(FnTypeId *fn_type_id, AstNode *proto_node, size_t param_count_alloc) { | |
| 902 | 902 | assert(proto_node->type == NodeTypeFnProto); |
| 903 | 903 | AstNodeFnProto *fn_proto = &proto_node->data.fn_proto; |
| 904 | 904 | |
| ... | ... | @@ -906,7 +906,7 @@ void init_fn_type_id(FnTypeId *fn_type_id, AstNode *proto_node) { |
| 906 | 906 | fn_type_id->is_naked = fn_proto->is_nakedcc; |
| 907 | 907 | fn_type_id->is_cold = fn_proto->is_coldcc; |
| 908 | 908 | fn_type_id->param_count = fn_proto->params.length; |
| 909 | fn_type_id->param_info = allocate_nonzero<FnTypeParamInfo>(fn_type_id->param_count); | |
| 909 | fn_type_id->param_info = allocate_nonzero<FnTypeParamInfo>(param_count_alloc); | |
| 910 | 910 | fn_type_id->next_param_index = 0; |
| 911 | 911 | fn_type_id->is_var_args = fn_proto->is_var_args; |
| 912 | 912 | } |
| ... | ... | @@ -916,7 +916,7 @@ static TypeTableEntry *analyze_fn_type(CodeGen *g, AstNode *proto_node, Scope *c |
| 916 | 916 | AstNodeFnProto *fn_proto = &proto_node->data.fn_proto; |
| 917 | 917 | |
| 918 | 918 | FnTypeId fn_type_id = {0}; |
| 919 | init_fn_type_id(&fn_type_id, proto_node); | |
| 919 | init_fn_type_id(&fn_type_id, proto_node, proto_node->data.fn_proto.params.length); | |
| 920 | 920 | |
| 921 | 921 | for (; fn_type_id.next_param_index < fn_type_id.param_count; fn_type_id.next_param_index += 1) { |
| 922 | 922 | AstNode *param_node = fn_proto->params.at(fn_type_id.next_param_index); |
src/analyze.hpp+1-1| ... | ... | @@ -70,7 +70,7 @@ VariableTableEntry *add_variable(CodeGen *g, AstNode *source_node, Scope *parent |
| 70 | 70 | TypeTableEntry *analyze_type_expr(CodeGen *g, Scope *scope, AstNode *node); |
| 71 | 71 | FnTableEntry *create_fn(AstNode *proto_node); |
| 72 | 72 | FnTableEntry *create_fn_raw(FnInline inline_value, bool internal_linkage); |
| 73 | void init_fn_type_id(FnTypeId *fn_type_id, AstNode *proto_node); | |
| 73 | void init_fn_type_id(FnTypeId *fn_type_id, AstNode *proto_node, size_t param_count_alloc); | |
| 74 | 74 | AstNode *get_param_decl_node(FnTableEntry *fn_entry, size_t index); |
| 75 | 75 | FnTableEntry *scope_get_fn_if_root(Scope *scope); |
| 76 | 76 | bool type_requires_comptime(TypeTableEntry *type_entry); |
src/ir.cpp+3-3| ... | ... | @@ -7866,7 +7866,7 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal |
| 7866 | 7866 | impl_fn->fndef_scope = create_fndef_scope(impl_fn->fn_def_node, parent_scope, impl_fn); |
| 7867 | 7867 | impl_fn->child_scope = &impl_fn->fndef_scope->base; |
| 7868 | 7868 | FnTypeId inst_fn_type_id = {0}; |
| 7869 | init_fn_type_id(&inst_fn_type_id, fn_proto_node); | |
| 7869 | init_fn_type_id(&inst_fn_type_id, fn_proto_node, call_param_count); | |
| 7870 | 7870 | inst_fn_type_id.param_count = 0; |
| 7871 | 7871 | inst_fn_type_id.is_var_args = false; |
| 7872 | 7872 | |
| ... | ... | @@ -7875,7 +7875,7 @@ static TypeTableEntry *ir_analyze_fn_call(IrAnalyze *ira, IrInstructionCall *cal |
| 7875 | 7875 | GenericFnTypeId *generic_id = allocate<GenericFnTypeId>(1); |
| 7876 | 7876 | generic_id->fn_entry = fn_entry; |
| 7877 | 7877 | generic_id->param_count = 0; |
| 7878 | generic_id->params = allocate<ConstExprValue>(src_param_count); | |
| 7878 | generic_id->params = allocate<ConstExprValue>(call_param_count); | |
| 7879 | 7879 | size_t next_proto_i = 0; |
| 7880 | 7880 | |
| 7881 | 7881 | if (first_arg_ptr) { |
| ... | ... | @@ -11483,7 +11483,7 @@ static TypeTableEntry *ir_analyze_instruction_fn_proto(IrAnalyze *ira, IrInstruc |
| 11483 | 11483 | assert(proto_node->type == NodeTypeFnProto); |
| 11484 | 11484 | |
| 11485 | 11485 | FnTypeId fn_type_id = {0}; |
| 11486 | init_fn_type_id(&fn_type_id, proto_node); | |
| 11486 | init_fn_type_id(&fn_type_id, proto_node, proto_node->data.fn_proto.params.length); | |
| 11487 | 11487 | |
| 11488 | 11488 | bool depends_on_compile_var = false; |
| 11489 | 11489 |