This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv.c: Duplicate more variables during cloning
authorKarl Williamson <khw@cpan.org>
Thu, 11 Feb 2021 18:17:48 +0000 (11:17 -0700)
committerKarl Williamson <khw@cpan.org>
Wed, 10 Aug 2022 00:05:59 +0000 (18:05 -0600)
These locale-related ones should be getting initialized in the new
thread, but be certain.

sv.c

diff --git a/sv.c b/sv.c
index ea4eac5..6f8fe60 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -15500,6 +15500,8 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
     PL_collxfrm_base   = proto_perl->Icollxfrm_base;
     PL_collxfrm_mult   = proto_perl->Icollxfrm_mult;
     PL_strxfrm_max_cp   = proto_perl->Istrxfrm_max_cp;
+    PL_strxfrm_is_behaved = proto_perl->Istrxfrm_is_behaved;
+    PL_strxfrm_NUL_replacement = proto_perl->Istrxfrm_NUL_replacement;
 #endif /* USE_LOCALE_COLLATE */
 
 #ifdef USE_LOCALE_NUMERIC
@@ -15818,14 +15820,16 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
  &&   defined(USE_THREAD_SAFE_LOCALE)     \
  && ! defined(HAS_QUERYLOCALE)
     for (i = 0; i < (int) C_ARRAY_LENGTH(PL_curlocales); i++) {
-        PL_curlocales[i] = savepv("."); /* An illegal value */
+        PL_curlocales[i] = SAVEPV(proto_perl->Icurlocales[i]);
     }
 #endif
 #ifdef USE_LOCALE_CTYPE
     Copy(proto_perl->Ifold_locale, PL_fold_locale, 256, U8);
     /* Should we warn if uses locale? */
     PL_warn_locale      = sv_dup_inc(proto_perl->Iwarn_locale, param);
-    PL_in_utf8_CTYPE_locale = proto_perl->Iin_utf8_CTYPE_locale;
+    PL_utf8locale             = proto_perl->Iutf8locale;
+    PL_in_utf8_CTYPE_locale   = proto_perl->Iin_utf8_CTYPE_locale;
+    PL_in_utf8_turkic_locale  = proto_perl->Iin_utf8_turkic_locale;
 #endif
 
 #ifdef USE_LOCALE_COLLATE