diff --git a/flamingo/ptm/vec.h b/flamingo/ptm/vec.h index 12613ca..ebf1e16 100644 --- a/flamingo/ptm/vec.h +++ b/flamingo/ptm/vec.h @@ -40,7 +40,7 @@ static inline int vec_map(flamingo_t* flamingo, flamingo_val_t* self, flamingo_a flamingo_val_t* const vec = val_alloc(); vec->kind = FLAMINGO_VAL_KIND_VEC; vec->vec.count = self->vec.count; - vec->vec.elems = malloc(vec->vec.count * sizeof *vec->vec.elems); + vec->vec.elems = calloc(vec->vec.count, sizeof *vec->vec.elems); assert(vec->vec.elems != NULL); for (size_t i = 0; i < vec->vec.count; i++) { diff --git a/tests/call_arg_eval_context.fl b/tests/call_arg_eval_context.fl index 3cf2ce1..ac5ce29 100644 --- a/tests/call_arg_eval_context.fl +++ b/tests/call_arg_eval_context.fl @@ -2,8 +2,6 @@ # When calling a function that is defined in a different source file, the context's source could be switched to the source file of the function being called before the argument expressions are evaluated. # This would cause these evaluations to use the wrong source file. -# TODO rename this - import .tests.call_arg_eval_context_helper assert function("zonnebloemgranen") == "zonnebloemgranen"