[RFA,2/3] Remove cleanup from ada_collect_symbol_completion_matches

Message ID 20180519160606.19969-3-tom@tromey.com
State New
Headers show
Series
  • More Ada cleanup removal
Related show

Commit Message

Tom Tromey May 19, 2018, 4:06 p.m.
ada_collect_symbol_completion_matches installs a null_cleanup but not
any other cleanups.  This patch removes it.

gdb/ChangeLog
2018-05-18  Tom Tromey  <tom@tromey.com>

	* ada-lang.c (ada_collect_symbol_completion_matches): Remove
	cleanup.
---
 gdb/ChangeLog  | 5 +++++
 gdb/ada-lang.c | 3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)

-- 
2.13.6

Comments

Simon Marchi May 20, 2018, 11:59 p.m. | #1
On 2018-05-19 12:06 PM, Tom Tromey wrote:
> ada_collect_symbol_completion_matches installs a null_cleanup but not

> any other cleanups.  This patch removes it.


It doesn't seem like any of the called function leaves a dangling cleanup, so LGTM.

Simon

Patch

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index da5f75030c..cbb0fe9d82 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -6445,7 +6445,6 @@  ada_collect_symbol_completion_matches (completion_tracker &tracker,
   struct objfile *objfile;
   const struct block *b, *surrounding_static_block = 0;
   struct block_iterator iter;
-  struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
 
   gdb_assert (code == TYPE_CODE_UNDEF);
 
@@ -6550,8 +6549,6 @@  ada_collect_symbol_completion_matches (completion_tracker &tracker,
 				lookup_name, text, word);
     }
   }
-
-  do_cleanups (old_chain);
 }
 
                                 /* Field Access */