X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Ftr%2Fcompound_path.c;h=11b19eb8b86683f957e08e2ac62ce211cb0dc7d0;hb=4524bf07ed17f358412754a50a76e7db852160b3;hp=6ac2ac540f04b685f5f5a72b6abaf88c46008757;hpb=0a4048fbaae21a969b0f03b066dde30a06968814;p=libfirm diff --git a/ir/tr/compound_path.c b/ir/tr/compound_path.c index 6ac2ac540..11b19eb8b 100644 --- a/ir/tr/compound_path.c +++ b/ir/tr/compound_path.c @@ -44,8 +44,7 @@ compound_graph_path *new_compound_graph_path(ir_type *tp, size_t length) assert(is_compound_type(tp) || is_Array_type(tp)); assert(length > 0); - res = (compound_graph_path*)xmalloc(sizeof(*res) + (length-1) * sizeof(res->list[0])); - memset(res, 0, sizeof(*res) + (length-1) * sizeof(res->list[0])); + res = XMALLOCFZ(compound_graph_path, list, length); res->kind = k_ir_compound_graph_path; res->tp = tp; res->len = length;