X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=scope.c;h=b8d45584e20cee5640265a976c831303bf5a4b85;hb=75cb7811ab1ee1be5f412611d5f34c9bb1166dc3;hp=020713f285d4938cbcacb8c6f358da3f6432483c;hpb=33c2748902d07b7ec367f87ad66e61e89f2aa994;p=p5sagit%2Fp5-mst-13.2.git diff --git a/scope.c b/scope.c index 020713f..b8d4558 100644 --- a/scope.c +++ b/scope.c @@ -1,6 +1,6 @@ /* scope.c * - * Copyright (c) 1991-1997, Larry Wall + * Copyright (c) 1991-1999, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -135,6 +135,19 @@ savestack_grow(void) #undef GROW void +tmps_grow(I32 n) +{ + dTHR; +#ifndef STRESS_REALLOC + if (n < 128) + n = (PL_tmps_max < 512) ? 128 : 512; +#endif + PL_tmps_max = PL_tmps_ix + n + 1; + Renew(PL_tmps_stack, PL_tmps_max, SV*); +} + + +void free_tmps(void) { dTHR; @@ -742,12 +755,8 @@ leave_scope(I32 base) sv = *(SV**)ptr; /* Can clear pad variable in place? */ if (SvREFCNT(sv) <= 1 && !SvOBJECT(sv)) { - if (SvTHINKFIRST(sv)) { - if (SvREADONLY(sv)) - croak("panic: leave_scope clearsv"); - if (SvROK(sv)) - sv_unref(sv); - } + if (SvTHINKFIRST(sv)) + sv_force_normal(sv); if (SvMAGICAL(sv)) mg_free(sv); @@ -863,7 +872,7 @@ cx_dump(PERL_CONTEXT *cx) { #ifdef DEBUGGING dTHR; - PerlIO_printf(Perl_debug_log, "CX %ld = %s\n", (long)(cx - cxstack), block_type[CxTYPE(cx)]); + PerlIO_printf(Perl_debug_log, "CX %ld = %s\n", (long)(cx - cxstack), PL_block_type[CxTYPE(cx)]); if (CxTYPE(cx) != CXt_SUBST) { PerlIO_printf(Perl_debug_log, "BLK_OLDSP = %ld\n", (long)cx->blk_oldsp); PerlIO_printf(Perl_debug_log, "BLK_OLDCOP = 0x%lx\n", (long)cx->blk_oldcop); @@ -893,8 +902,8 @@ cx_dump(PERL_CONTEXT *cx) PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_IN_EVAL = %ld\n", (long)cx->blk_eval.old_in_eval); PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_OP_TYPE = %s (%s)\n", - op_name[cx->blk_eval.old_op_type], - op_desc[cx->blk_eval.old_op_type]); + PL_op_name[cx->blk_eval.old_op_type], + PL_op_desc[cx->blk_eval.old_op_type]); PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_NAME = %s\n", cx->blk_eval.old_name); PerlIO_printf(Perl_debug_log, "BLK_EVAL.OLD_EVAL_ROOT = 0x%lx\n", @@ -930,8 +939,8 @@ cx_dump(PERL_CONTEXT *cx) (long)cx->sb_iters); PerlIO_printf(Perl_debug_log, "SB_MAXITERS = %ld\n", (long)cx->sb_maxiters); - PerlIO_printf(Perl_debug_log, "SB_SAFEBASE = %ld\n", - (long)cx->sb_safebase); + PerlIO_printf(Perl_debug_log, "SB_RFLAGS = %ld\n", + (long)cx->sb_rflags); PerlIO_printf(Perl_debug_log, "SB_ONCE = %ld\n", (long)cx->sb_once); PerlIO_printf(Perl_debug_log, "SB_ORIG = %s\n",