diff options
author | Balaji V. Iyer <balaji.v.iyer@intel.com> | 2012-12-21 17:21:25 +0000 |
---|---|---|
committer | Balaji V. Iyer <balaji.v.iyer@intel.com> | 2012-12-21 17:21:25 +0000 |
commit | e59a76441cfd912ecae7f94a4ee09579327fe7b6 (patch) | |
tree | 303275ad3fd846a48b82e00ab210ebdbd82ccecd | |
parent | e095ee23e03a1a830c96870b6ebdc454a9f29750 (diff) |
Fixed a memory leak.
2012-12-21 Balaji V. Iyer <balaji.v.iyer@intel.com>
* elem-function-common.c (find_elem_fn_parm_type_1): Freed a malloced
variable.
(find_elem_fn_name): Likewise.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/cilkplus@194674 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.cilkplus | 6 | ||||
-rw-r--r-- | gcc/elem-function-common.c | 16 |
2 files changed, 19 insertions, 3 deletions
diff --git a/gcc/ChangeLog.cilkplus b/gcc/ChangeLog.cilkplus index 5dc8d0718bc..a4efc68430e 100644 --- a/gcc/ChangeLog.cilkplus +++ b/gcc/ChangeLog.cilkplus @@ -1,3 +1,9 @@ +2012-12-21 Balaji V. Iyer <balaji.v.iyer@intel.com> + + * elem-function-common.c (find_elem_fn_parm_type_1): Freed a malloced + variable. + (find_elem_fn_name): Likewise. + 2012-12-18 Balaji V. Iyer <balaji.v.iyer@intel.com> * tree-vect-loop.c (vect_determine_vectorization_factor): Replaced all diff --git a/gcc/elem-function-common.c b/gcc/elem-function-common.c index e570683a5ea..6123db20ce7 100644 --- a/gcc/elem-function-common.c +++ b/gcc/elem-function-common.c @@ -186,13 +186,18 @@ find_elem_fn_parm_type_1 (tree fndecl, int parm_no, tree *step_size) if (step_size != NULL) *step_size = build_int_cst (integer_type_node, elem_fn_values->linear_steps[ii]); + XDELETEVEC (elem_fn_values); return TYPE_LINEAR; } for (ii = 0; ii < elem_fn_values->no_uvars; ii++) - if (elem_fn_values->uniform_location[ii] == parm_no) - return TYPE_UNIFORM; + if (elem_fn_values->uniform_location[ii] == parm_no) + { + XDELETEVEC (elem_fn_values); + return TYPE_UNIFORM; + } + XDELETEVEC (elem_fn_values); return TYPE_NONE; } @@ -259,11 +264,15 @@ find_elem_fn_name (tree old_fndecl, tree vectype_out, (int) TYPE_VECTOR_SUBPARTS (vectype_out)); warning_at (EXPR_LOCATION (old_fndecl), 0, (const char *)warning_string); + XDELETEVEC (elem_fn_values); return NULL_TREE; } } else - return NULL_TREE; + { + XDELETEVEC (elem_fn_values); + return NULL_TREE; + } } else return NULL_TREE; @@ -287,6 +296,7 @@ find_elem_fn_name (tree old_fndecl, tree vectype_out, DECL_MODE (new_fndecl) = TYPE_MODE (vectype_out); } + XDELETEVEC (elem_fn_values); return new_fndecl; } |