From: Nick Ing-Simmons Date: Fri, 6 Oct 2000 20:25:37 +0000 (+0000) Subject: Make sv_upgrade() undo READONLY|FAKE shared string hackery. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4045699e205d2008d5a12b39ce34bd633246eadc;p=p5sagit%2Fp5-mst-13.2.git Make sv_upgrade() undo READONLY|FAKE shared string hackery. To fix (sort {$a <=> $b} keys %hash) in particular but should cover a number of other as-yet-unknown cases as well. p4raw-id: //depot/perl@7162 --- diff --git a/sv.c b/sv.c index e7bd003..633c30d 100644 --- a/sv.c +++ b/sv.c @@ -981,6 +981,9 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) mt = SVt_PVNV; break; case SVt_PVIV: + if (SvREADONLY(sv) && SvFAKE(sv)) { + sv_force_normal(sv); + } pv = SvPVX(sv); cur = SvCUR(sv); len = SvLEN(sv);