From: Pedro Alves Date: Tue, 17 Aug 2010 21:12:32 +0000 (+0000) Subject: * breakpoint.c (decref_bp_location): Assert the reference count is X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0807b50c1a17fa98badf223a3f77ed94ed9b7452;p=binutils-gdb.git * breakpoint.c (decref_bp_location): Assert the reference count is sane. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8193f85c8b0..0e44e2973fe 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2010-08-17 Pedro Alves + + PR breakpoints/11371 + + * breakpoint.c (decref_bp_location): Assert the reference count is + sane. + 2010-08-17 Pedro Alves PR breakpoints/11371 diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index f23f5181fc4..6d5958375c4 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;