* breakpoint.c (decref_bp_location): Assert the reference count is
authorPedro Alves <palves@redhat.com>
Tue, 17 Aug 2010 21:12:32 +0000 (21:12 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 17 Aug 2010 21:12:32 +0000 (21:12 +0000)
sane.

gdb/ChangeLog
gdb/breakpoint.c

index 8193f85c8b061143f809e63ca4b2c90f08460c33..0e44e2973fe8ed2d88e471adb23282cfae65dd99 100644 (file)
@@ -1,3 +1,10 @@
+2010-08-17  Pedro Alves  <pedro@codesourcery.com>
+
+       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
index f23f5181fc48f102a4bfcc9a19f0b943929f65c1..6d5958375c4df7cacbf396bdcb9f004eb199ab7c 100644 (file)
@@ -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;