This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] fix two memory leaks
- From: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 Apr 2007 23:37:50 +0200
- Subject: [patch] fix two memory leaks
Hello,
this patch fixes two memory leaks (the one in finalize_ssa_vuse_ops
being a quite serious one, as this function is called a lot). OK
once it passes bootstrap & regtesting?
Zdenek
* tree-ssa-structalias.c (delete_points_to_sets): Free graph->complex.
* tree-ssa-operands.c (finalize_ssa_vuse_ops): Free new_ops.
Index: tree-ssa-structalias.c
===================================================================
*** tree-ssa-structalias.c (revision 124004)
--- tree-ssa-structalias.c (working copy)
*************** delete_points_to_sets (void)
*** 4877,4882 ****
--- 4877,4883 ----
for (i = 0; VEC_iterate (varinfo_t, varmap, i, v); i++)
VEC_free (constraint_t, heap, graph->complex[i]);
+ free (graph->complex);
free (graph->rep);
free (graph->succs);
Index: tree-ssa-operands.c
===================================================================
*** tree-ssa-operands.c (revision 124004)
--- tree-ssa-operands.c (working copy)
*************** finalize_ssa_vuse_ops (tree stmt)
*** 1072,1077 ****
--- 1072,1078 ----
SET_USE (VUSE_OP_PTR (last, (int) i), op);
VUSE_OPS (stmt) = last;
+ VEC_free (tree, heap, new_ops);
}
#ifdef ENABLE_CHECKING