Stop sv_force_normal from crashing on ro globs under old cow
authorFather Chrysostomos <sprout@cpan.org>
Tue, 2 Oct 2012 05:10:53 +0000 (22:10 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 3 Oct 2012 01:27:47 +0000 (18:27 -0700)
This allows t/lib/universal.t to pass under PERL_OLD_COPY_ON_WRITE.

sv.c

index 774154c..01ef3df 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -4720,7 +4720,7 @@ Perl_sv_force_normal_flags(pTHX_ register SV *const sv, const U32 flags)
 
 #ifdef PERL_OLD_COPY_ON_WRITE
     if (SvREADONLY(sv)) {
-       if (SvFAKE(sv)) {
+       if (SvIsCOW(sv)) {
            const char * const pvx = SvPVX_const(sv);
            const STRLEN len = SvLEN(sv);
            const STRLEN cur = SvCUR(sv);