Skip to content

Commit

Permalink
sv.c: Duplicate more variables during cloning
Browse files Browse the repository at this point in the history
These locale-related ones should be getting initialized in the new
thread, but be certain.
  • Loading branch information
khwilliamson committed May 5, 2021
1 parent 9ad8d05 commit 16f0bd1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sv.c
Expand Up @@ -15327,6 +15327,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
Expand Down Expand Up @@ -15647,16 +15649,20 @@ 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
/* Should we warn if uses locale? */
PL_warn_locale = sv_dup_inc(proto_perl->Iwarn_locale, param);
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
PL_collation_name = SAVEPV(proto_perl->Icollation_name);
PL_in_utf8_COLLATE_locale = proto_perl->Iin_utf8_COLLATE_locale;
#endif /* USE_LOCALE_COLLATE */

#ifdef USE_LOCALE_NUMERIC
Expand Down

0 comments on commit 16f0bd1

Please sign in to comment.