diff --git a/src/interpreter.c b/src/interpreter.c index 53d218e..a61d5a6 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -79,7 +79,6 @@ int Interpreter_ParseFunction(Interpreter* self, CallFrame* top_frame, size_t st Token* function_name = Interpreter_GetToken(self, top_frame->instruction_pointer); - memset(f, 0, sizeof(*f)); f->name = function_name->get.identifier; top_frame->instruction_pointer++; @@ -87,6 +86,7 @@ int Interpreter_ParseFunction(Interpreter* self, CallFrame* top_frame, size_t st top_frame->instruction_pointer++; Token* parameter_type = Interpreter_ExpectToken(self, top_frame, stop_index); + f->parameters = NULL; ParameterDefinition** pdef = &f->parameters; while (parameter_type->type != TOKENTYPE_ARROW) { top_frame->instruction_pointer++; @@ -109,6 +109,7 @@ int Interpreter_ParseFunction(Interpreter* self, CallFrame* top_frame, size_t st (*pdef)->type = parameter_type->get.identifier; (*pdef)->name = parameter_name->get.identifier; + (*pdef)->next = NULL; pdef = &((*pdef)->next); parameter_type = Interpreter_ExpectToken(self, top_frame, stop_index);