summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorAbhijit Menon-Sen <ams@wiw.org>2001-07-13 12:42:36 +0530
committerJarkko Hietaniemi <jhi@iki.fi>2001-07-13 03:42:05 +0000
commitee5f07612ef92580d32ca15f5c1d6416f95df779 (patch)
tree0d9dd6578e33d0fe3ec720196a6692e4f604e463 /sv.c
parent77caf834c201d3982a815b3d51794b6e3a769c6d (diff)
downloadperl-ee5f07612ef92580d32ca15f5c1d6416f95df779.tar.gz
Re: [PATCH] Re: Memory corruption? Read-only $_?
Message-ID: <20010713071236.C5669@lustre.dyn.wiw.org> p4raw-id: //depot/perl@11343
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sv.c b/sv.c
index d8929dfc8a..7a23cc8c03 100644
--- a/sv.c
+++ b/sv.c
@@ -1570,14 +1570,11 @@ Perl_sv_grow(pTHX_ register SV *sv, register STRLEN newlen)
Renew(s,newlen,char);
}
else {
- /* If we're growing a newSVpvn_share()d SV, we must unshare
- the PVX by hand, since sv_force_normal_flags() will try
- to grow the SV. AMS 20010713 */
+ /* sv_force_normal_flags() must not try to unshare the new
+ PVX we allocate below. AMS 20010713 */
if (SvREADONLY(sv) && SvFAKE(sv)) {
- STRLEN len = SvCUR(sv);
SvFAKE_off(sv);
SvREADONLY_off(sv);
- unsharepvn(SvPVX(sv), SvUTF8(sv) ? -(I32)len : len, SvUVX(sv));
}
New(703, s, newlen, char);
}