diff options
author | Joshua Pritikin <joshua.pritikin@db.com> | 1998-07-01 06:09:43 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-04 05:52:34 +0000 |
commit | d689ffdd6d1d8fd913b48f3cb3a376bd99e0a6cf (patch) | |
tree | 4149cdb70a157cfb0f43ffc2910a0da15c42f486 /pp.c | |
parent | 8fb9a439a71a5e6b7adf7c46052298d23dd9cab7 (diff) | |
download | perl-d689ffdd6d1d8fd913b48f3cb3a376bd99e0a6cf.tar.gz |
fixes for mortalization bug in xsubpp, other efficiency tweaks
Message-Id: <H00000e500086fb3@MHS>
Subject: [PATCH _69] sv_2mortal fix
p4raw-id: //depot/perl@1306
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -2623,8 +2623,7 @@ PP(pp_splice) if (AvREAL(ary)) { EXTEND_MORTAL(length); for (i = length, dst = MARK; i; i--) { - if (!SvIMMORTAL(*dst)) - sv_2mortal(*dst); /* free them eventualy */ + sv_2mortal(*dst); /* free them eventualy */ dst++; } } @@ -2633,8 +2632,7 @@ PP(pp_splice) else { *MARK = AvARRAY(ary)[offset+length-1]; if (AvREAL(ary)) { - if (!SvIMMORTAL(*MARK)) - sv_2mortal(*MARK); + sv_2mortal(*MARK); for (i = length - 1, dst = &AvARRAY(ary)[offset]; i > 0; i--) SvREFCNT_dec(*dst++); /* free them now */ } @@ -2722,8 +2720,7 @@ PP(pp_splice) if (AvREAL(ary)) { EXTEND_MORTAL(length); for (i = length, dst = MARK; i; i--) { - if (!SvIMMORTAL(*dst)) - sv_2mortal(*dst); /* free them eventualy */ + sv_2mortal(*dst); /* free them eventualy */ dst++; } } @@ -2734,8 +2731,7 @@ PP(pp_splice) else if (length--) { *MARK = tmparyval[length]; if (AvREAL(ary)) { - if (!SvIMMORTAL(*MARK)) - sv_2mortal(*MARK); + sv_2mortal(*MARK); while (length-- > 0) SvREFCNT_dec(tmparyval[length]); } @@ -2783,7 +2779,7 @@ PP(pp_pop) djSP; AV *av = (AV*)POPs; SV *sv = av_pop(av); - if (!SvIMMORTAL(sv) && AvREAL(av)) + if (AvREAL(av)) (void)sv_2mortal(sv); PUSHs(sv); RETURN; @@ -2797,7 +2793,7 @@ PP(pp_shift) EXTEND(SP, 1); if (!sv) RETPUSHUNDEF; - if (!SvIMMORTAL(sv) && AvREAL(av)) + if (AvREAL(av)) (void)sv_2mortal(sv); PUSHs(sv); RETURN; |