diff options
author | Pedro Alves <palves@redhat.com> | 2010-08-17 21:12:32 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2010-08-17 21:12:32 +0000 |
commit | 0807b50c1a17fa98badf223a3f77ed94ed9b7452 (patch) | |
tree | d92fbc3b7e4fd759e045a3d02aaae7d0472f4823 | |
parent | f431efe54030450b082231080d76404f0f8064ae (diff) | |
download | gdb-0807b50c1a17fa98badf223a3f77ed94ed9b7452.zip gdb-0807b50c1a17fa98badf223a3f77ed94ed9b7452.tar.gz gdb-0807b50c1a17fa98badf223a3f77ed94ed9b7452.tar.bz2 |
* breakpoint.c (decref_bp_location): Assert the reference count is
sane.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/breakpoint.c | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8193f85..0e44e29 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -2,6 +2,13 @@ PR breakpoints/11371 + * breakpoint.c (decref_bp_location): Assert the reference count is + sane. + +2010-08-17 Pedro Alves <pedro@codesourcery.com> + + PR breakpoints/11371 + * breakpoint.c (breakpoint_init_inferior): Decrement the location's reference count instead of deleting right away. (bpstat_free): Decrement the location's reference count. Make diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index f23f518..6d59583 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5423,6 +5423,8 @@ incref_bp_location (struct bp_location *bl) static void decref_bp_location (struct bp_location **blp) { + gdb_assert ((*blp)->refc > 0); + if (--(*blp)->refc == 0) free_bp_location (*blp); *blp = NULL; |