diff mbox

[4/6] gdb: Remove final cleanup from find_overload_match

Message ID d0793c10354c069ba60cfdd34fa8e505e0952895.1546382416.git.andrew.burgess@embecosm.com
State New
Headers show

Commit Message

Andrew Burgess Jan. 1, 2019, 10:45 p.m. UTC
This patch removes the setup of a null_cleanup in
valops.c:find_overload_match, and all the calls to do_cleanups.

gdb/ChangeLog:

	* valops.c (find_overload_match): Remove use of null_cleanup, and
	calls to do_cleanups.
---
 gdb/ChangeLog | 5 +++++
 gdb/valops.c  | 6 ------
 2 files changed, 5 insertions(+), 6 deletions(-)

Comments

Tom Tromey Jan. 2, 2019, 3:13 p.m. UTC | #1
>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> This patch removes the setup of a null_cleanup in
Andrew> valops.c:find_overload_match, and all the calls to do_cleanups.

Andrew> gdb/ChangeLog:

Andrew> 	* valops.c (find_overload_match): Remove use of null_cleanup, and
Andrew> 	calls to do_cleanups.

Ok.  Thank you.

Tom
diff mbox

Patch

diff --git a/gdb/valops.c b/gdb/valops.c
index 1a9d6a6f958..75ff7058b7c 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -2516,8 +2516,6 @@  find_overload_match (gdb::array_view<value *> args,
   struct type *basetype = NULL;
   LONGEST boffset;
 
-  struct cleanup *all_cleanups = make_cleanup (null_cleanup, NULL);
-
   const char *obj_type_name = NULL;
   const char *func_name = NULL;
   gdb::unique_xmalloc_ptr<char> temp_func;
@@ -2547,7 +2545,6 @@  find_overload_match (gdb::array_view<value *> args,
 	  if (*valp)
 	    {
 	      *staticp = 1;
-	      do_cleanups (all_cleanups);
 	      return 0;
 	    }
 	}
@@ -2693,7 +2690,6 @@  find_overload_match (gdb::array_view<value *> args,
       if (func_name == NULL)
         {
 	  *symp = fsym;
-	  do_cleanups (all_cleanups);
           return 0;
         }
 
@@ -2820,8 +2816,6 @@  find_overload_match (gdb::array_view<value *> args,
       *objp = temp;
     }
 
-  do_cleanups (all_cleanups);
-
   switch (match_quality)
     {
     case INCOMPATIBLE: