Change 11343 by jhi@alpha on 2001/07/13 03:42:05
Subject: Re: [PATCH] Re: Memory corruption? Read-only $_?
From: Abhijit Menon-Sen <[EMAIL PROTECTED]>
Date: Fri, 13 Jul 2001 07:12:36 +0530
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/sv.c#442 edit
Differences ...
==== //depot/perl/sv.c#442 (text) ====
Index: perl/sv.c
--- perl/sv.c.~1~ Thu Jul 12 21:45:06 2001
+++ perl/sv.c Thu Jul 12 21:45:06 2001
@@ -1570,14 +1570,11 @@
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);
}
End of Patch.