public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5950] c++: don't leak 'arglist' in build_new_op
@ 2021-12-14 12:49 Patrick Palka
  0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2021-12-14 12:49 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:336dc544ebca867794a8e57c65afe303fd8ecc66

commit r12-5950-g336dc544ebca867794a8e57c65afe303fd8ecc66
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue Dec 14 07:48:54 2021 -0500

    c++: don't leak 'arglist' in build_new_op
    
    gcc/cp/ChangeLog:
    
            * call.c (build_new_op): Use releasing_vec for arglist.  Declare
            conv in the scope it's used.

Diff:
---
 gcc/cp/call.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 28bd8e0c260..347df5da35d 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6461,13 +6461,12 @@ build_new_op (const op_location_t &loc, enum tree_code code, int flags,
 	      tsubst_flags_t complain)
 {
   struct z_candidate *candidates = 0, *cand;
-  vec<tree, va_gc> *arglist;
+  releasing_vec arglist;
   tree result = NULL_TREE;
   bool result_valid_p = false;
   enum tree_code code2 = ERROR_MARK;
   enum tree_code code_orig_arg1 = ERROR_MARK;
   enum tree_code code_orig_arg2 = ERROR_MARK;
-  conversion *conv;
   void *p;
   bool strict_p;
   bool any_viable_p;
@@ -6543,7 +6542,6 @@ build_new_op (const op_location_t &loc, enum tree_code code, int flags,
       arg2_type = integer_type_node;
     }
 
-  vec_alloc (arglist, 3);
   arglist->quick_push (arg1);
   if (arg2 != NULL_TREE)
     arglist->quick_push (arg2);
@@ -6814,7 +6812,7 @@ build_new_op (const op_location_t &loc, enum tree_code code, int flags,
 	     corresponding parameters of the selected operation function,
 	     except that the second standard conversion sequence of a
 	     user-defined conversion sequence (12.3.3.1.2) is not applied."  */
-	  conv = cand->convs[0];
+	  conversion *conv = cand->convs[0];
 	  if (conv->user_conv_p)
 	    {
 	      conv = strip_standard_conversion (conv);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-14 12:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 12:49 [gcc r12-5950] c++: don't leak 'arglist' in build_new_op Patrick Palka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).