This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 07/40] fix linespec bug noticed by the checker
- From: Tom Tromey <tromey at redhat dot com>
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 09 May 2013 12:50:07 -0600
- Subject: [PATCH 07/40] fix linespec bug noticed by the checker
- References: <cover dot 1368124285 dot git dot tromey at redhat dot com>
This fixes a linespec bug noticed by the cleanup checker.
find_linespec_symbols did this:
cleanup = demangle_for_lookup (name, state->language->la_language,
&lookup_name);
[...]
cleanup = make_cleanup (xfree, canon);
But this is wrong, as it makes a subsequent call to do_cleanups not
clean up all the local state.
* linespec.c (find_linespec_symbols): Don't reassign to 'cleanup'.
---
gdb/linespec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 1c7a7a0..4bbd6e4 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -3093,7 +3093,7 @@ find_linespec_symbols (struct linespec_state *state,
if (canon != NULL)
{
lookup_name = canon;
- cleanup = make_cleanup (xfree, canon);
+ make_cleanup (xfree, canon);
}
/* It's important to not call expand_symtabs_matching unnecessarily
--
1.8.1.4