From 0807b50c1a17fa98badf223a3f77ed94ed9b7452 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Tue, 17 Aug 2010 21:12:32 +0000 Subject: [PATCH] * breakpoint.c (decref_bp_location): Assert the reference count is sane. --- gdb/ChangeLog | 7 +++++++ gdb/breakpoint.c | 2 ++ 2 files changed, 9 insertions(+) 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; -- 2.30.2