From 2cb9c8590a0a0b80cfaa305fbcde2cb9efcf6e48 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Thu, 9 May 2013 17:24:55 +0000 Subject: [PATCH] * symfile.c (decrement_reading_symtab): Add assert. (increment_reading_symtab): Ditto. --- gdb/ChangeLog | 5 +++++ gdb/symfile.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2d1e3e1c04a..f997abf495d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-05-09 Doug Evans + + * symfile.c (decrement_reading_symtab): Add assert. + (increment_reading_symtab): Ditto. + 2013-05-09 Joel Brobecker * source.c (forward_search_command): Replace call to getc diff --git a/gdb/symfile.c b/gdb/symfile.c index 32d6ad052bb..36f5918b098 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -160,6 +160,7 @@ static void decrement_reading_symtab (void *dummy) { currently_reading_symtab--; + gdb_assert (currently_reading_symtab >= 0); } /* Increment currently_reading_symtab and return a cleanup that can be @@ -169,6 +170,7 @@ struct cleanup * increment_reading_symtab (void) { ++currently_reading_symtab; + gdb_assert (currently_reading_symtab > 0); return make_cleanup (decrement_reading_symtab, NULL); } -- 2.30.2