We may not even have a list of slabs when Perl_Slab_Free is called.
Nicholas Clark [Mon, 2 Apr 2007 21:27:26 +0000 (21:27 +0000)]
p4raw-id: //depot/perl@30835

op.c

diff --git a/op.c b/op.c
index 47901c1..1f9cb8f 100644 (file)
--- a/op.c
+++ b/op.c
@@ -235,10 +235,9 @@ Perl_Slab_Free(pTHX_ void *op)
 #  endif
        
 #ifdef PERL_DEBUG_READONLY_OPS
+       U32 count = PL_slab_count;
        /* Need to remove this slab from our list of slabs */
-       {
-           U32 count = PL_slab_count;
-
+       if (count) {
            while (count--) {
                if (PL_slabs[count] == slab) {
                    /* Found it. Move the entry at the end to overwrite it.  */