Make sv_upgrade() undo READONLY|FAKE shared string hackery.
Nick Ing-Simmons [Fri, 6 Oct 2000 20:25:37 +0000 (20:25 +0000)]
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

sv.c

diff --git a/sv.c b/sv.c
index e7bd003..633c30d 100644 (file)
--- 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);