fix symtab.c
authorTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:20:02 +0000 (17:20 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 30 May 2013 17:20:02 +0000 (17:20 +0000)
search_symbols had some bad code resulting in a cleanup being both
discarded and run.

* symtab.c (search_symbols): Introduce a null cleanup for
'retval_chain'.

gdb/ChangeLog
gdb/symtab.c

index 1f07f38..5331d5b 100644 (file)
@@ -1,5 +1,10 @@
 2013-05-30  Tom Tromey  <tromey@redhat.com>
 
+       * symtab.c (search_symbols): Introduce a null cleanup for
+       'retval_chain'.
+
+2013-05-30  Tom Tromey  <tromey@redhat.com>
+
        * python/py-value.c (valpy_binop): Call do_cleanups before
        exiting loop.
 
index def556b..9040035 100644 (file)
@@ -3529,7 +3529,7 @@ search_symbols (char *regexp, enum search_domain kind,
                                                &datum);
   }
 
-  retval_chain = old_chain;
+  retval_chain = make_cleanup (null_cleanup, NULL);
 
   /* Here, we search through the minimal symbol tables for functions
      and variables that match, and force their symbols to be read.