提交 5bee8061 编写于 作者: N Niko Matsakis

fix valgrind error: allocate enough space for all type descs

上级 1e674ffe
......@@ -247,7 +247,7 @@ void upcall_s_create_shared_type_desc(s_create_shared_type_desc_args *args)
// Copy the main part of the type descriptor:
const type_desc *td = args->td;
int n_params = td->n_params;
size_t sz = sizeof(type_desc) + sizeof(type_desc*) * n_params;
size_t sz = sizeof(type_desc) + sizeof(type_desc*) * (n_params+1);
args->res = (type_desc*) task->kernel->malloc(sz, "create_shared_type_desc");
memcpy(args->res, td, sizeof(type_desc));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册