summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-04 18:21:34 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-11-04 22:45:35 -0800
commit3bf28c7efbcf1a4748684c5e67060fc0deaa9427 (patch)
tree0a63a16ff50eb0f3c31ecf11bf06d037ba84a898 /op.c
parentee5ee8539c7146494698baa407f2b0ee47da8439 (diff)
downloadperl-3bf28c7efbcf1a4748684c5e67060fc0deaa9427.tar.gz
op.c:opslab_force_free: Make paranoid code reflect reality
When opslab_force_free is called, the CV still has a reference count on the slab. In fact, we don’t even bother lowering it if all goes well, but simply free the slab with the reference count set to 1. So the paranoid code that increments the reference count before free- ing an op is not necessary. Also, the shortcut out of the loop was never triggered, as it was checking for a reference count of 0, rather than 1.
Diffstat (limited to 'op.c')
-rw-r--r--op.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/op.c b/op.c
index 488665faac..93b71bd57d 100644
--- a/op.c
+++ b/op.c
@@ -380,9 +380,8 @@ Perl_opslab_force_free(pTHX_ OPSLAB *slab)
)
) {
assert(slot->opslot_op.op_slabbed);
- slab->opslab_refcnt++; /* op_free may free slab */
op_free(&slot->opslot_op);
- if (!--slab->opslab_refcnt) goto free;
+ if (slab->opslab_refcnt == 1) goto free;
}
}
} while ((slab2 = slab2->opslab_next));