aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2021-07-13 14:42:09 -0400
committerJason Merrill <jason@redhat.com>2021-07-14 15:01:27 -0400
commit91bb571d200e551f427e337e00494e0b4f229876 (patch)
treeb72e29de68aa237224fbafabf8b0271734aa3fc4 /gcc/cp/semantics.c
parentb15e301748f0e042379909e32b3ade439dd8f8f9 (diff)
downloadgcc-91bb571d200e551f427e337e00494e0b4f229876.zip
gcc-91bb571d200e551f427e337e00494e0b4f229876.tar.gz
gcc-91bb571d200e551f427e337e00494e0b4f229876.tar.bz2
vec: use auto_vec in a few more places
The uses of vec<T> in get_all_loop_exits and process_conditional were memory leaks, as .release() was never called for them. The other changes are some cases that did have proper release handling, but it's simpler to leave releasing to the auto_vec destructor. gcc/ChangeLog: * sel-sched-ir.h (get_all_loop_exits): Use auto_vec. gcc/cp/ChangeLog: * class.c (struct find_final_overrider_data): Use auto_vec. (find_final_overrider): Remove explicit release. * coroutines.cc (process_conditional): Use auto_vec. * cp-gimplify.c (struct cp_genericize_data): Use auto_vec. (cp_genericize_tree): Remove explicit release. * parser.c (cp_parser_objc_at_property_declaration): Use auto_delete_vec. * semantics.c (omp_reduction_lookup): Use auto_vec.
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index b080259..b97dc1f 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -5774,7 +5774,7 @@ omp_reduction_lookup (location_t loc, tree id, tree type, tree *baselinkp,
if (!id && CLASS_TYPE_P (type) && TYPE_BINFO (type))
{
- vec<tree> ambiguous = vNULL;
+ auto_vec<tree> ambiguous;
tree binfo = TYPE_BINFO (type), base_binfo, ret = NULL_TREE;
unsigned int ix;
if (ambiguousp == NULL)
@@ -5811,7 +5811,6 @@ omp_reduction_lookup (location_t loc, tree id, tree type, tree *baselinkp,
if (idx == 0)
str = get_spaces (str);
}
- ambiguous.release ();
ret = error_mark_node;
baselink = NULL_TREE;
}