summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-15 02:15:25 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-15 02:15:25 +0000
commit6ff81951f79dec32e15a779d288c1047f0e4fefb (patch)
tree53c645778f7a018e0bd74a2ec2fe9c64833ea13d /pp.c
parent48c036b1eb8f866b948f33704ee6152323a5aad9 (diff)
downloadperl-6ff81951f79dec32e15a779d288c1047f0e4fefb.tar.gz
[win32] merge changes#906,907,909,910 from maintbranch
p4raw-link: @910 on //depot/maint-5.004/perl: ae941ac0da8f453f0d31df7b7293e50b3e5a46f1 p4raw-link: @909 on //depot/maint-5.004/perl: 8b3d696ffd11cf2e49f6eaa575b829ab0a55352d p4raw-link: @907 on //depot/maint-5.004/perl: 3cb3c1abada5765ba4166ebe59e2e20d737ec21b p4raw-link: @906 on //depot/maint-5.004/perl: ae389c8a29b487f4434c465442dfb611507a4a38 p4raw-id: //depot/win32/perl@977
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/pp.c b/pp.c
index 0ebb98b7b6..bd5fd38e7e 100644
--- a/pp.c
+++ b/pp.c
@@ -322,7 +322,11 @@ PP(pp_pos)
}
LvTYPE(TARG) = '.';
- LvTARG(TARG) = sv;
+ if (LvTARG(TARG) != sv) {
+ if (LvTARG(TARG))
+ SvREFCNT_dec(LvTARG(TARG));
+ LvTARG(TARG) = SvREFCNT_inc(sv);
+ }
PUSHs(TARG); /* no SvSETMAGIC */
RETURN;
}
@@ -1880,7 +1884,11 @@ PP(pp_substr)
}
LvTYPE(TARG) = 'x';
- LvTARG(TARG) = sv;
+ if (LvTARG(TARG) != sv) {
+ if (LvTARG(TARG))
+ SvREFCNT_dec(LvTARG(TARG));
+ LvTARG(TARG) = SvREFCNT_inc(sv);
+ }
LvTARGOFF(TARG) = pos;
LvTARGLEN(TARG) = rem;
}
@@ -1917,7 +1925,11 @@ PP(pp_vec)
}
LvTYPE(TARG) = 'v';
- LvTARG(TARG) = src;
+ if (LvTARG(TARG) != src) {
+ if (LvTARG(TARG))
+ SvREFCNT_dec(LvTARG(TARG));
+ LvTARG(TARG) = SvREFCNT_inc(src);
+ }
LvTARGOFF(TARG) = offset;
LvTARGLEN(TARG) = size;
}