From: Dave Mitchell Date: Thu, 23 Jun 2005 22:48:40 +0000 (+0000) Subject: don't repopulate PADTMP slots with null SVs when freeing ops X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9ad9869ce96041d364276ea3274adb7f55af5eff;p=p5sagit%2Fp5-mst-13.2.git don't repopulate PADTMP slots with null SVs when freeing ops p4raw-id: //depot/perl@24967 --- diff --git a/ext/B/t/f_sort.t b/ext/B/t/f_sort.t index 7b34713..fa1ece3 100644 --- a/ext/B/t/f_sort.t +++ b/ext/B/t/f_sort.t @@ -104,7 +104,7 @@ checkOptree(note => q{}, # 7 <0> pushmark s # 8 <#> gv[*articles] s # 9 <1> rv2av[t2] lKRM*/1 -# a <2> aassign[t5] KS +# a <2> aassign[t3] KS # b <1> leavesub[1 ref] K/REFC,1 EOT_EOT # 1 <;> nextstate(main 546 (eval 15):1) v @@ -178,7 +178,7 @@ checkOptree(note => q{}, # 7 <0> pushmark s # 8 <#> gv[*articles] s # 9 <1> rv2av[t2] lKRM*/1 -# a <2> aassign[t5] KS +# a <2> aassign[t3] KS # b <1> leavesub[1 ref] K/REFC,1 EOT_EOT # 1 <;> nextstate(main 546 (eval 15):1) v @@ -215,7 +215,7 @@ checkOptree(note => q{}, # 7 <0> pushmark s # 8 <#> gv[*articles] s # 9 <1> rv2av[t2] lKRM*/1 -# a <2> aassign[t5] KS +# a <2> aassign[t3] KS # b <1> leavesub[1 ref] K/REFC,1 EOT_EOT # 1 <;> nextstate(main 546 (eval 15):1) v @@ -252,7 +252,7 @@ checkOptree(note => q{}, # 7 <0> pushmark s # 8 <#> gv[*articles] s # 9 <1> rv2av[t2] lKRM*/1 -# a <2> aassign[t5] KS +# a <2> aassign[t3] KS # b <1> leavesub[1 ref] K/REFC,1 EOT_EOT # 1 <;> nextstate(main 546 (eval 15):1) v @@ -799,7 +799,7 @@ checkOptree(note => q{}, # d <0> pushmark s # e <#> gv[*result] s # f <1> rv2av[t2] lKRM*/1 -# g <2> aassign[t5] KS/COMMON +# g <2> aassign[t3] KS/COMMON # h <1> leavesub[1 ref] K/REFC,1 EOT_EOT # 1 <;> nextstate(main 547 (eval 15):1) v diff --git a/ext/B/t/optree_samples.t b/ext/B/t/optree_samples.t index 442ae6a..4f0d782 100644 --- a/ext/B/t/optree_samples.t +++ b/ext/B/t/optree_samples.t @@ -607,7 +607,7 @@ checkOptree ( name => 'map $_+42, 10..20', # 3 <$> const[AV ] s # 4 <1> rv2av lKPM/1 # 5 <@> mapstart K -# 6 <|> mapwhile(other->7)[t7] K +# 6 <|> mapwhile(other->7)[t5] K # 7 <#> gvsv[*_] s # 8 <$> const[IV 42] s # 9 <2> add[t2] sK/2 diff --git a/pad.c b/pad.c index ed68c40..e1f7b69 100644 --- a/pad.c +++ b/pad.c @@ -1055,10 +1055,17 @@ Perl_pad_swipe(pTHX_ PADOFFSET po, bool refadjust) if (refadjust) SvREFCNT_dec(PL_curpad[po]); + + /* if pad tmps aren't shared between ops, then there's no need to + * create a new tmp when an existing op is freed */ +#ifdef USE_BROKEN_PAD_RESET PL_curpad[po] = NEWSV(1107,0); SvPADTMP_on(PL_curpad[po]); +#else + PL_curpad[po] = &PL_sv_undef; if ((I32)po < PL_padix) PL_padix = po - 1; +#endif }