summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/parse.c b/parse.c
index c1238ad..7538202 100644
--- a/parse.c
+++ b/parse.c
@@ -1380,9 +1380,7 @@ static Status parse_expr(Parser *p, Expression *e, Token *end) {
++t->token;
Type *fn_t = &fn->foreign.type;
fn_t->kind = TYPE_FN;
- FnType *fn_type = fn_t->fn = parser_malloc(p, sizeof *fn_t);
- fn_type->constness = NULL;
- fn_type->types = NULL;
+ FnType *fn_type = fn_t->fn = parser_calloc(p, 1, sizeof *fn_type);
/* reserve space for return type (Type + CType) */
parser_arr_add_ptr(p, fn_type->types);
parser_arr_add_ptr(p, fn->foreign.ctypes);