From: Nicholas Clark Date: Thu, 12 Apr 2007 18:52:49 +0000 (+0000) Subject: Fix two errors in the OP debugging code. Now all test errors relate X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5892a4d46c7c2069892f8918ef1f02a94c09a1a4;p=p5sagit%2Fp5-mst-13.2.git Fix two errors in the OP debugging code. Now all test errors relate to newCONSTSUB(). p4raw-id: //depot/perl@30936 --- diff --git a/op.c b/op.c index e1b5ec5..5436a71 100644 --- a/op.c +++ b/op.c @@ -186,7 +186,6 @@ Perl_pending_Slabs_to_ro(pTHX) { read only. Also, do it ahead of the loop in case the warn triggers, and a warn handler has an eval */ - free(PL_slabs); PL_slabs = NULL; PL_slab_count = 0; @@ -194,13 +193,15 @@ Perl_pending_Slabs_to_ro(pTHX) { PL_OpSpace = 0; while (count--) { - const void *start = slabs[count]; + void *const start = slabs[count]; const size_t size = PERL_SLAB_SIZE* sizeof(I32*); if(mprotect(start, size, PROT_READ)) { Perl_warn(aTHX_ "mprotect for %p %lu failed with %d", start, (unsigned long) size, errno); } } + + free(slabs); } STATIC void diff --git a/sv.c b/sv.c index 5d84cb3..4ce7071 100644 --- a/sv.c +++ b/sv.c @@ -10932,6 +10932,10 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, HINTS_REFCNT_UNLOCK; } PL_curcop = (COP*)any_dup(proto_perl->Tcurcop, proto_perl); +#ifdef PERL_DEBUG_READONLY_OPS + PL_slabs = NULL; + PL_slab_count = 0; +#endif /* pseudo environmental stuff */ PL_origargc = proto_perl->Iorigargc;