This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv.c: Fix cloning of interp variable
authorKarl Williamson <khw@cpan.org>
Tue, 13 Jan 2015 05:06:34 +0000 (22:06 -0700)
committerKarl Williamson <khw@cpan.org>
Tue, 13 Jan 2015 19:19:59 +0000 (12:19 -0700)
This should have been cloned by sv_dup_inc.  I don't know why it didn't
fail outside of Win32, but fail there it did, spectacularly, but only
when I temporarily change some C code to force execution of the affected
code, which only gets executed for problematic locales, which may very
well not exist on most machines.

sv.c

diff --git a/sv.c b/sv.c
index fe092c4..d86a61e 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -14598,9 +14598,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     /* Unicode features (see perlrun/-C) */
     PL_unicode         = proto_perl->Iunicode;
 
-    /* Should we warn if uses locale? */
-    PL_warn_locale      = proto_perl->Iwarn_locale;
-
     /* Pre-5.8 signals control */
     PL_signals         = proto_perl->Isignals;
 
@@ -14914,6 +14911,11 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
 
     PL_subname         = sv_dup_inc(proto_perl->Isubname, param);
 
+#ifdef USE_LOCALE_CTYPE
+    /* Should we warn if uses locale? */
+    PL_warn_locale      = sv_dup_inc(proto_perl->Iwarn_locale, param);
+#endif
+
 #ifdef USE_LOCALE_COLLATE
     PL_collation_name  = SAVEPV(proto_perl->Icollation_name);
 #endif /* USE_LOCALE_COLLATE */