summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-11-24 20:48:54 -0700
committerKarl Williamson <khw@cpan.org>2019-11-26 19:38:14 -0700
commita8def808210e08cea0b7889fea7c5146b21af4ed (patch)
tree40bd3017953f36bf853b7dec6c07e818d1d3588e
parente4b61f959ac649d109da4ede1fba8cfa793a79a4 (diff)
downloadperl-a8def808210e08cea0b7889fea7c5146b21af4ed.tar.gz
Move regex global variables to interpreter level
This is part of fixing gh #17154 This scenario from the ticket (https://github.com/Perl/perl5/issues/17154#issuecomment-558877358) shows why this fix is necessary: main interpreter initializes PL_AboveLatin1 to an SV it owns loads threads::lite and creates a new thread/interpreter which initializes PL_AboveLatin1 to a SV owned by the new interpreter threads::lite child interpreter finishes, freeing all of its SVs, PL_AboveLatin1 is now invalid main interpreter uses a regexp that relies on PL_AboveLatin1, dies horribly. By making these interpreter level variables, this is avoided. There is extra copying, but it is just the SV headers, as the real data is kept as static C arrays.
-rw-r--r--embedvar.h93
-rw-r--r--intrpvar.h35
-rw-r--r--perl.c69
-rw-r--r--perlapi.h62
-rw-r--r--perlvars.h35
-rw-r--r--regcomp.c2
-rw-r--r--sv.c41
7 files changed, 177 insertions, 160 deletions
diff --git a/embedvar.h b/embedvar.h
index 2f96743593..63a741edb6 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -40,6 +40,9 @@
# define vTHX PERL_GET_INTERP
# endif
+#define PL_AboveLatin1 (vTHX->IAboveLatin1)
+#define PL_Assigned_invlist (vTHX->IAssigned_invlist)
+#define PL_CCC_non0_non230 (vTHX->ICCC_non0_non230)
#define PL_DBcontrol (vTHX->IDBcontrol)
#define PL_DBcv (vTHX->IDBcv)
#define PL_DBgv (vTHX->IDBgv)
@@ -50,15 +53,28 @@
#define PL_DBtrace (vTHX->IDBtrace)
#define PL_Dir (vTHX->IDir)
#define PL_Env (vTHX->IEnv)
+#define PL_GCB_invlist (vTHX->IGCB_invlist)
+#define PL_HasMultiCharFold (vTHX->IHasMultiCharFold)
+#define PL_InBitmap (vTHX->IInBitmap)
+#define PL_InMultiCharFold (vTHX->IInMultiCharFold)
+#define PL_LB_invlist (vTHX->ILB_invlist)
#define PL_LIO (vTHX->ILIO)
+#define PL_Latin1 (vTHX->ILatin1)
#define PL_Mem (vTHX->IMem)
#define PL_MemParse (vTHX->IMemParse)
#define PL_MemShared (vTHX->IMemShared)
+#define PL_Posix_ptrs (vTHX->IPosix_ptrs)
+#define PL_Private_Use (vTHX->IPrivate_Use)
#define PL_Proc (vTHX->IProc)
+#define PL_SB_invlist (vTHX->ISB_invlist)
+#define PL_SCX_invlist (vTHX->ISCX_invlist)
#define PL_Sock (vTHX->ISock)
#define PL_StdIO (vTHX->IStdIO)
#define PL_Sv (vTHX->ISv)
#define PL_TR_SPECIAL_HANDLING_UTF8 (vTHX->ITR_SPECIAL_HANDLING_UTF8)
+#define PL_UpperLatin1 (vTHX->IUpperLatin1)
+#define PL_WB_invlist (vTHX->IWB_invlist)
+#define PL_XPosix_ptrs (vTHX->IXPosix_ptrs)
#define PL_Xpv (vTHX->IXpv)
#define PL_an (vTHX->Ian)
#define PL_argvgv (vTHX->Iargvgv)
@@ -156,6 +172,7 @@
#define PL_in_clean_objs (vTHX->Iin_clean_objs)
#define PL_in_eval (vTHX->Iin_eval)
#define PL_in_load_module (vTHX->Iin_load_module)
+#define PL_in_some_fold (vTHX->Iin_some_fold)
#define PL_in_utf8_COLLATE_locale (vTHX->Iin_utf8_COLLATE_locale)
#define PL_in_utf8_CTYPE_locale (vTHX->Iin_utf8_CTYPE_locale)
#define PL_in_utf8_turkic_locale (vTHX->Iin_utf8_turkic_locale)
@@ -332,6 +349,20 @@
#define PL_unitcheckav_save (vTHX->Iunitcheckav_save)
#define PL_unlockhook (vTHX->Iunlockhook)
#define PL_unsafe (vTHX->Iunsafe)
+#define PL_utf8_charname_begin (vTHX->Iutf8_charname_begin)
+#define PL_utf8_charname_continue (vTHX->Iutf8_charname_continue)
+#define PL_utf8_idcont (vTHX->Iutf8_idcont)
+#define PL_utf8_idstart (vTHX->Iutf8_idstart)
+#define PL_utf8_mark (vTHX->Iutf8_mark)
+#define PL_utf8_perl_idcont (vTHX->Iutf8_perl_idcont)
+#define PL_utf8_perl_idstart (vTHX->Iutf8_perl_idstart)
+#define PL_utf8_tofold (vTHX->Iutf8_tofold)
+#define PL_utf8_tolower (vTHX->Iutf8_tolower)
+#define PL_utf8_tosimplefold (vTHX->Iutf8_tosimplefold)
+#define PL_utf8_totitle (vTHX->Iutf8_totitle)
+#define PL_utf8_toupper (vTHX->Iutf8_toupper)
+#define PL_utf8_xidcont (vTHX->Iutf8_xidcont)
+#define PL_utf8_xidstart (vTHX->Iutf8_xidstart)
#define PL_utf8cache (vTHX->Iutf8cache)
#define PL_utf8locale (vTHX->Iutf8locale)
#define PL_warn_locale (vTHX->Iwarn_locale)
@@ -344,40 +375,8 @@
#if defined(PERL_GLOBAL_STRUCT)
-#define PL_AboveLatin1 (my_vars->GAboveLatin1)
-#define PL_GAboveLatin1 (my_vars->GAboveLatin1)
-#define PL_Assigned_invlist (my_vars->GAssigned_invlist)
-#define PL_GAssigned_invlist (my_vars->GAssigned_invlist)
-#define PL_CCC_non0_non230 (my_vars->GCCC_non0_non230)
-#define PL_GCCC_non0_non230 (my_vars->GCCC_non0_non230)
#define PL_C_locale_obj (my_vars->GC_locale_obj)
#define PL_GC_locale_obj (my_vars->GC_locale_obj)
-#define PL_GCB_invlist (my_vars->GGCB_invlist)
-#define PL_GGCB_invlist (my_vars->GGCB_invlist)
-#define PL_HasMultiCharFold (my_vars->GHasMultiCharFold)
-#define PL_GHasMultiCharFold (my_vars->GHasMultiCharFold)
-#define PL_InBitmap (my_vars->GInBitmap)
-#define PL_GInBitmap (my_vars->GInBitmap)
-#define PL_InMultiCharFold (my_vars->GInMultiCharFold)
-#define PL_GInMultiCharFold (my_vars->GInMultiCharFold)
-#define PL_LB_invlist (my_vars->GLB_invlist)
-#define PL_GLB_invlist (my_vars->GLB_invlist)
-#define PL_Latin1 (my_vars->GLatin1)
-#define PL_GLatin1 (my_vars->GLatin1)
-#define PL_Posix_ptrs (my_vars->GPosix_ptrs)
-#define PL_GPosix_ptrs (my_vars->GPosix_ptrs)
-#define PL_Private_Use (my_vars->GPrivate_Use)
-#define PL_GPrivate_Use (my_vars->GPrivate_Use)
-#define PL_SB_invlist (my_vars->GSB_invlist)
-#define PL_GSB_invlist (my_vars->GSB_invlist)
-#define PL_SCX_invlist (my_vars->GSCX_invlist)
-#define PL_GSCX_invlist (my_vars->GSCX_invlist)
-#define PL_UpperLatin1 (my_vars->GUpperLatin1)
-#define PL_GUpperLatin1 (my_vars->GUpperLatin1)
-#define PL_WB_invlist (my_vars->GWB_invlist)
-#define PL_GWB_invlist (my_vars->GWB_invlist)
-#define PL_XPosix_ptrs (my_vars->GXPosix_ptrs)
-#define PL_GXPosix_ptrs (my_vars->GXPosix_ptrs)
#define PL_appctx (my_vars->Gappctx)
#define PL_Gappctx (my_vars->Gappctx)
#define PL_check (my_vars->Gcheck)
@@ -408,8 +407,6 @@
#define PL_Ghash_state (my_vars->Ghash_state)
#define PL_hints_mutex (my_vars->Ghints_mutex)
#define PL_Ghints_mutex (my_vars->Ghints_mutex)
-#define PL_in_some_fold (my_vars->Gin_some_fold)
-#define PL_Gin_some_fold (my_vars->Gin_some_fold)
#define PL_keyword_plugin (my_vars->Gkeyword_plugin)
#define PL_Gkeyword_plugin (my_vars->Gkeyword_plugin)
#define PL_keyword_plugin_mutex (my_vars->Gkeyword_plugin_mutex)
@@ -496,36 +493,8 @@
#define PL_Guser_def_props_aTHX (my_vars->Guser_def_props_aTHX)
#define PL_user_prop_mutex (my_vars->Guser_prop_mutex)
#define PL_Guser_prop_mutex (my_vars->Guser_prop_mutex)
-#define PL_utf8_charname_begin (my_vars->Gutf8_charname_begin)
-#define PL_Gutf8_charname_begin (my_vars->Gutf8_charname_begin)
-#define PL_utf8_charname_continue (my_vars->Gutf8_charname_continue)
-#define PL_Gutf8_charname_continue (my_vars->Gutf8_charname_continue)
#define PL_utf8_foldclosures (my_vars->Gutf8_foldclosures)
#define PL_Gutf8_foldclosures (my_vars->Gutf8_foldclosures)
-#define PL_utf8_idcont (my_vars->Gutf8_idcont)
-#define PL_Gutf8_idcont (my_vars->Gutf8_idcont)
-#define PL_utf8_idstart (my_vars->Gutf8_idstart)
-#define PL_Gutf8_idstart (my_vars->Gutf8_idstart)
-#define PL_utf8_mark (my_vars->Gutf8_mark)
-#define PL_Gutf8_mark (my_vars->Gutf8_mark)
-#define PL_utf8_perl_idcont (my_vars->Gutf8_perl_idcont)
-#define PL_Gutf8_perl_idcont (my_vars->Gutf8_perl_idcont)
-#define PL_utf8_perl_idstart (my_vars->Gutf8_perl_idstart)
-#define PL_Gutf8_perl_idstart (my_vars->Gutf8_perl_idstart)
-#define PL_utf8_tofold (my_vars->Gutf8_tofold)
-#define PL_Gutf8_tofold (my_vars->Gutf8_tofold)
-#define PL_utf8_tolower (my_vars->Gutf8_tolower)
-#define PL_Gutf8_tolower (my_vars->Gutf8_tolower)
-#define PL_utf8_tosimplefold (my_vars->Gutf8_tosimplefold)
-#define PL_Gutf8_tosimplefold (my_vars->Gutf8_tosimplefold)
-#define PL_utf8_totitle (my_vars->Gutf8_totitle)
-#define PL_Gutf8_totitle (my_vars->Gutf8_totitle)
-#define PL_utf8_toupper (my_vars->Gutf8_toupper)
-#define PL_Gutf8_toupper (my_vars->Gutf8_toupper)
-#define PL_utf8_xidcont (my_vars->Gutf8_xidcont)
-#define PL_Gutf8_xidcont (my_vars->Gutf8_xidcont)
-#define PL_utf8_xidstart (my_vars->Gutf8_xidstart)
-#define PL_Gutf8_xidstart (my_vars->Gutf8_xidstart)
#define PL_veto_cleanup (my_vars->Gveto_cleanup)
#define PL_Gveto_cleanup (my_vars->Gveto_cleanup)
#define PL_watch_pvx (my_vars->Gwatch_pvx)
diff --git a/intrpvar.h b/intrpvar.h
index cbbbaddc08..5369292590 100644
--- a/intrpvar.h
+++ b/intrpvar.h
@@ -898,6 +898,41 @@ PERLVAR(I, internal_random_state, PL_RANDOM_STATE_TYPE)
PERLVARA(I, TR_SPECIAL_HANDLING_UTF8, UTF8_MAXBYTES, char)
+PERLVAR(I, AboveLatin1, SV *)
+PERLVAR(I, Assigned_invlist, SV *)
+PERLVAR(I, GCB_invlist, SV *)
+PERLVAR(I, HasMultiCharFold, SV *)
+PERLVAR(I, InMultiCharFold, SV *)
+PERLVAR(I, Latin1, SV *)
+PERLVAR(I, LB_invlist, SV *)
+PERLVAR(I, SB_invlist, SV *)
+PERLVAR(I, SCX_invlist, SV *)
+PERLVAR(I, UpperLatin1, SV *) /* Code points 128 - 255 */
+
+/* List of characters that participate in any fold defined by Unicode */
+PERLVAR(I, in_some_fold, SV *)
+
+PERLVAR(I, utf8_idcont, SV *)
+PERLVAR(I, utf8_idstart, SV *)
+PERLVAR(I, utf8_perl_idcont, SV *)
+PERLVAR(I, utf8_perl_idstart, SV *)
+PERLVAR(I, utf8_xidcont, SV *)
+PERLVAR(I, utf8_xidstart, SV *)
+PERLVAR(I, WB_invlist, SV *)
+PERLVARA(I, XPosix_ptrs, POSIX_CC_COUNT, SV *)
+PERLVARA(I, Posix_ptrs, POSIX_CC_COUNT, SV *)
+PERLVAR(I, utf8_toupper, SV *)
+PERLVAR(I, utf8_totitle, SV *)
+PERLVAR(I, utf8_tolower, SV *)
+PERLVAR(I, utf8_tofold, SV *)
+PERLVAR(I, utf8_tosimplefold, SV *)
+PERLVAR(I, utf8_charname_begin, SV *)
+PERLVAR(I, utf8_charname_continue, SV *)
+PERLVAR(I, utf8_mark, SV *)
+PERLVARI(I, InBitmap, SV *, NULL)
+PERLVAR(I, CCC_non0_non230, SV *)
+PERLVAR(I, Private_Use, SV *)
+
/* If you are adding a U8 or U16, check to see if there are 'Space' comments
* above on where there are gaps which currently will be structure padding. */
diff --git a/perl.c b/perl.c
index e6fe14f967..39687a59b1 100644
--- a/perl.c
+++ b/perl.c
@@ -1197,6 +1197,75 @@ perl_destruct(pTHXx)
PL_warn_locale = NULL;
#endif
+ SvREFCNT_dec(PL_AboveLatin1);
+ PL_AboveLatin1 = NULL;
+ SvREFCNT_dec(PL_Assigned_invlist);
+ PL_Assigned_invlist = NULL;
+ SvREFCNT_dec(PL_GCB_invlist);
+ PL_GCB_invlist = NULL;
+ SvREFCNT_dec(PL_HasMultiCharFold);
+ PL_HasMultiCharFold = NULL;
+ SvREFCNT_dec(PL_InMultiCharFold);
+ PL_InMultiCharFold = NULL;
+ SvREFCNT_dec(PL_Latin1);
+ PL_Latin1 = NULL;
+ SvREFCNT_dec(PL_LB_invlist);
+ PL_LB_invlist = NULL;
+ SvREFCNT_dec(PL_SB_invlist);
+ PL_SB_invlist = NULL;
+ SvREFCNT_dec(PL_SCX_invlist);
+ PL_SCX_invlist = NULL;
+ SvREFCNT_dec(PL_UpperLatin1);
+ PL_UpperLatin1 = NULL;
+ SvREFCNT_dec(PL_in_some_fold);
+ PL_in_some_fold = NULL;
+ SvREFCNT_dec(PL_utf8_idcont);
+ PL_utf8_idcont = NULL;
+ SvREFCNT_dec(PL_utf8_idstart);
+ PL_utf8_idstart = NULL;
+ SvREFCNT_dec(PL_utf8_perl_idcont);
+ PL_utf8_perl_idcont = NULL;
+ SvREFCNT_dec(PL_utf8_perl_idstart);
+ PL_utf8_perl_idstart = NULL;
+ SvREFCNT_dec(PL_utf8_xidcont);
+ PL_utf8_xidcont = NULL;
+ SvREFCNT_dec(PL_utf8_xidstart);
+ PL_utf8_xidstart = NULL;
+ SvREFCNT_dec(PL_WB_invlist);
+ PL_WB_invlist = NULL;
+ SvREFCNT_dec(PL_utf8_toupper);
+ PL_utf8_toupper = NULL;
+ SvREFCNT_dec(PL_utf8_totitle);
+ PL_utf8_totitle = NULL;
+ SvREFCNT_dec(PL_utf8_tolower);
+ PL_utf8_tolower = NULL;
+ SvREFCNT_dec(PL_utf8_tofold);
+ PL_utf8_tofold = NULL;
+ SvREFCNT_dec(PL_utf8_tosimplefold);
+ PL_utf8_tosimplefold = NULL;
+ SvREFCNT_dec(PL_utf8_charname_begin);
+ PL_utf8_charname_begin = NULL;
+ SvREFCNT_dec(PL_utf8_charname_continue);
+ PL_utf8_charname_continue = NULL;
+ SvREFCNT_dec(PL_utf8_mark);
+ PL_utf8_mark = NULL;
+ SvREFCNT_dec(PL_InBitmap);
+ PL_InBitmap = NULL;
+ SvREFCNT_dec(PL_CCC_non0_non230);
+ PL_CCC_non0_non230 = NULL;
+ SvREFCNT_dec(PL_Private_Use);
+ PL_Private_Use = NULL;
+
+ for (i = 0; i < POSIX_CC_COUNT; i++) {
+ SvREFCNT_dec(PL_XPosix_ptrs[i]);
+ PL_XPosix_ptrs[i] = NULL;
+
+ if (i != _CC_CASED) { /* A copy of Alpha */
+ SvREFCNT_dec(PL_Posix_ptrs[i]);
+ PL_Posix_ptrs[i] = NULL;
+ }
+ }
+
if (!specialWARN(PL_compiling.cop_warnings))
PerlMemShared_free(PL_compiling.cop_warnings);
PL_compiling.cop_warnings = NULL;
diff --git a/perlapi.h b/perlapi.h
index 8b74919f31..221493437c 100644
--- a/perlapi.h
+++ b/perlapi.h
@@ -99,40 +99,8 @@ END_EXTERN_C
#else /* !PERL_CORE */
-#undef PL_AboveLatin1
-#define PL_AboveLatin1 (*Perl_GAboveLatin1_ptr(NULL))
-#undef PL_Assigned_invlist
-#define PL_Assigned_invlist (*Perl_GAssigned_invlist_ptr(NULL))
-#undef PL_CCC_non0_non230
-#define PL_CCC_non0_non230 (*Perl_GCCC_non0_non230_ptr(NULL))
#undef PL_C_locale_obj
#define PL_C_locale_obj (*Perl_GC_locale_obj_ptr(NULL))
-#undef PL_GCB_invlist
-#define PL_GCB_invlist (*Perl_GGCB_invlist_ptr(NULL))
-#undef PL_HasMultiCharFold
-#define PL_HasMultiCharFold (*Perl_GHasMultiCharFold_ptr(NULL))
-#undef PL_InBitmap
-#define PL_InBitmap (*Perl_GInBitmap_ptr(NULL))
-#undef PL_InMultiCharFold
-#define PL_InMultiCharFold (*Perl_GInMultiCharFold_ptr(NULL))
-#undef PL_LB_invlist
-#define PL_LB_invlist (*Perl_GLB_invlist_ptr(NULL))
-#undef PL_Latin1
-#define PL_Latin1 (*Perl_GLatin1_ptr(NULL))
-#undef PL_Posix_ptrs
-#define PL_Posix_ptrs (*Perl_GPosix_ptrs_ptr(NULL))
-#undef PL_Private_Use
-#define PL_Private_Use (*Perl_GPrivate_Use_ptr(NULL))
-#undef PL_SB_invlist
-#define PL_SB_invlist (*Perl_GSB_invlist_ptr(NULL))
-#undef PL_SCX_invlist
-#define PL_SCX_invlist (*Perl_GSCX_invlist_ptr(NULL))
-#undef PL_UpperLatin1
-#define PL_UpperLatin1 (*Perl_GUpperLatin1_ptr(NULL))
-#undef PL_WB_invlist
-#define PL_WB_invlist (*Perl_GWB_invlist_ptr(NULL))
-#undef PL_XPosix_ptrs
-#define PL_XPosix_ptrs (*Perl_GXPosix_ptrs_ptr(NULL))
#undef PL_appctx
#define PL_appctx (*Perl_Gappctx_ptr(NULL))
#undef PL_check
@@ -163,8 +131,6 @@ END_EXTERN_C
#define PL_hash_state (*Perl_Ghash_state_ptr(NULL))
#undef PL_hints_mutex
#define PL_hints_mutex (*Perl_Ghints_mutex_ptr(NULL))
-#undef PL_in_some_fold
-#define PL_in_some_fold (*Perl_Gin_some_fold_ptr(NULL))
#undef PL_keyword_plugin
#define PL_keyword_plugin (*Perl_Gkeyword_plugin_ptr(NULL))
#undef PL_keyword_plugin_mutex
@@ -247,36 +213,8 @@ END_EXTERN_C
#define PL_user_def_props_aTHX (*Perl_Guser_def_props_aTHX_ptr(NULL))
#undef PL_user_prop_mutex
#define PL_user_prop_mutex (*Perl_Guser_prop_mutex_ptr(NULL))
-#undef PL_utf8_charname_begin
-#define PL_utf8_charname_begin (*Perl_Gutf8_charname_begin_ptr(NULL))
-#undef PL_utf8_charname_continue
-#define PL_utf8_charname_continue (*Perl_Gutf8_charname_continue_ptr(NULL))
#undef PL_utf8_foldclosures
#define PL_utf8_foldclosures (*Perl_Gutf8_foldclosures_ptr(NULL))
-#undef PL_utf8_idcont
-#define PL_utf8_idcont (*Perl_Gutf8_idcont_ptr(NULL))
-#undef PL_utf8_idstart
-#define PL_utf8_idstart (*Perl_Gutf8_idstart_ptr(NULL))
-#undef PL_utf8_mark
-#define PL_utf8_mark (*Perl_Gutf8_mark_ptr(NULL))
-#undef PL_utf8_perl_idcont
-#define PL_utf8_perl_idcont (*Perl_Gutf8_perl_idcont_ptr(NULL))
-#undef PL_utf8_perl_idstart
-#define PL_utf8_perl_idstart (*Perl_Gutf8_perl_idstart_ptr(NULL))
-#undef PL_utf8_tofold
-#define PL_utf8_tofold (*Perl_Gutf8_tofold_ptr(NULL))
-#undef PL_utf8_tolower
-#define PL_utf8_tolower (*Perl_Gutf8_tolower_ptr(NULL))
-#undef PL_utf8_tosimplefold
-#define PL_utf8_tosimplefold (*Perl_Gutf8_tosimplefold_ptr(NULL))
-#undef PL_utf8_totitle
-#define PL_utf8_totitle (*Perl_Gutf8_totitle_ptr(NULL))
-#undef PL_utf8_toupper
-#define PL_utf8_toupper (*Perl_Gutf8_toupper_ptr(NULL))
-#undef PL_utf8_xidcont
-#define PL_utf8_xidcont (*Perl_Gutf8_xidcont_ptr(NULL))
-#undef PL_utf8_xidstart
-#define PL_utf8_xidstart (*Perl_Gutf8_xidstart_ptr(NULL))
#undef PL_veto_cleanup
#define PL_veto_cleanup (*Perl_Gveto_cleanup_ptr(NULL))
#undef PL_watch_pvx
diff --git a/perlvars.h b/perlvars.h
index 976649a409..2137554404 100644
--- a/perlvars.h
+++ b/perlvars.h
@@ -275,41 +275,6 @@ PERLVARA(G, hash_chars, (1+256) * sizeof(U32), unsigned char) /* perl.c and hv.h
PERLVAR(G, perllib_sep, char)
#endif
-PERLVAR(G, AboveLatin1, SV *)
-PERLVAR(G, Assigned_invlist, SV *)
-PERLVAR(G, GCB_invlist, SV *)
-PERLVAR(G, HasMultiCharFold, SV *)
-PERLVAR(G, InMultiCharFold, SV *)
-PERLVAR(G, Latin1, SV *)
-PERLVAR(G, LB_invlist, SV *)
-PERLVAR(G, SB_invlist, SV *)
-PERLVAR(G, SCX_invlist, SV *)
-PERLVAR(G, UpperLatin1, SV *) /* Code points 128 - 255 */
-
-/* List of characters that participate in any fold defined by Unicode */
-PERLVAR(G, in_some_fold, SV *)
-
-PERLVAR(G, utf8_idcont, SV *)
-PERLVAR(G, utf8_idstart, SV *)
-PERLVAR(G, utf8_perl_idcont, SV *)
-PERLVAR(G, utf8_perl_idstart, SV *)
-PERLVAR(G, utf8_xidcont, SV *)
-PERLVAR(G, utf8_xidstart, SV *)
-PERLVAR(G, WB_invlist, SV *)
-PERLVARA(G, XPosix_ptrs, POSIX_CC_COUNT, SV *)
-PERLVARA(G, Posix_ptrs, POSIX_CC_COUNT, SV *)
-PERLVAR(G, utf8_toupper, SV *)
-PERLVAR(G, utf8_totitle, SV *)
-PERLVAR(G, utf8_tolower, SV *)
-PERLVAR(G, utf8_tofold, SV *)
-PERLVAR(G, utf8_tosimplefold, SV *)
-PERLVAR(G, utf8_charname_begin, SV *)
-PERLVAR(G, utf8_charname_continue, SV *)
-PERLVAR(G, utf8_mark, SV *)
-PERLVARI(G, InBitmap, SV *, NULL)
-PERLVAR(G, CCC_non0_non230, SV *)
-PERLVAR(G, Private_Use, SV *)
-
/* Definitions of user-defined \p{} properties, as the subs that define them
* are only called once */
PERLVARI(G, user_def_props, HV *, NULL)
diff --git a/regcomp.c b/regcomp.c
index 0d47769bd4..916103f4e8 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -22608,7 +22608,7 @@ Perl_init_uniprops(pTHX)
#endif
- /* Set up the inversion list global variables */
+ /* Set up the inversion list interpreter-level variables */
PL_XPosix_ptrs[_CC_ASCII] = _new_invlist_C_array(uni_prop_ptrs[UNI_ASCII]);
PL_XPosix_ptrs[_CC_ALPHANUMERIC] = _new_invlist_C_array(uni_prop_ptrs[UNI_XPOSIXALNUM]);
diff --git a/sv.c b/sv.c
index 2fb9750329..0a853bccfa 100644
--- a/sv.c
+++ b/sv.c
@@ -15682,6 +15682,47 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_setlocale_buf = NULL;
PL_setlocale_bufsize = 0;
+ /* Unicode inversion lists */
+
+ PL_AboveLatin1 = sv_dup_inc(proto_perl->IAboveLatin1, param);
+ PL_Assigned_invlist = sv_dup_inc(proto_perl->IAssigned_invlist, param);
+ PL_GCB_invlist = sv_dup_inc(proto_perl->IGCB_invlist, param);
+ PL_HasMultiCharFold = sv_dup_inc(proto_perl->IHasMultiCharFold, param);
+ PL_InMultiCharFold = sv_dup_inc(proto_perl->IInMultiCharFold, param);
+ PL_Latin1 = sv_dup_inc(proto_perl->ILatin1, param);
+ PL_LB_invlist = sv_dup_inc(proto_perl->ILB_invlist, param);
+ PL_SB_invlist = sv_dup_inc(proto_perl->ISB_invlist, param);
+ PL_SCX_invlist = sv_dup_inc(proto_perl->ISCX_invlist, param);
+ PL_UpperLatin1 = sv_dup_inc(proto_perl->IUpperLatin1, param);
+ PL_in_some_fold = sv_dup_inc(proto_perl->Iin_some_fold, param);
+ PL_utf8_idcont = sv_dup_inc(proto_perl->Iutf8_idcont, param);
+ PL_utf8_idstart = sv_dup_inc(proto_perl->Iutf8_idstart, param);
+ PL_utf8_perl_idcont = sv_dup_inc(proto_perl->Iutf8_perl_idcont, param);
+ PL_utf8_perl_idstart = sv_dup_inc(proto_perl->Iutf8_perl_idstart, param);
+ PL_utf8_xidcont = sv_dup_inc(proto_perl->Iutf8_xidcont, param);
+ PL_utf8_xidstart = sv_dup_inc(proto_perl->Iutf8_xidstart, param);
+ PL_WB_invlist = sv_dup_inc(proto_perl->IWB_invlist, param);
+ for (i = 0; i < POSIX_CC_COUNT; i++) {
+ PL_XPosix_ptrs[i] = sv_dup_inc(proto_perl->IXPosix_ptrs[i], param);
+ if (i != _CC_CASED && i != _CC_VERTSPACE) {
+ PL_Posix_ptrs[i] = sv_dup_inc(proto_perl->IPosix_ptrs[i], param);
+ }
+ }
+ PL_Posix_ptrs[_CC_CASED] = PL_Posix_ptrs[_CC_ALPHA];
+ PL_Posix_ptrs[_CC_VERTSPACE] = NULL;
+
+ PL_utf8_toupper = sv_dup_inc(proto_perl->Iutf8_toupper, param);
+ PL_utf8_totitle = sv_dup_inc(proto_perl->Iutf8_totitle, param);
+ PL_utf8_tolower = sv_dup_inc(proto_perl->Iutf8_tolower, param);
+ PL_utf8_tofold = sv_dup_inc(proto_perl->Iutf8_tofold, param);
+ PL_utf8_tosimplefold = sv_dup_inc(proto_perl->Iutf8_tosimplefold, param);
+ PL_utf8_charname_begin = sv_dup_inc(proto_perl->Iutf8_charname_begin, param);
+ PL_utf8_charname_continue = sv_dup_inc(proto_perl->Iutf8_charname_continue, param);
+ PL_utf8_mark = sv_dup_inc(proto_perl->Iutf8_mark, param);
+ PL_InBitmap = sv_dup_inc(proto_perl->IInBitmap, param);
+ PL_CCC_non0_non230 = sv_dup_inc(proto_perl->ICCC_non0_non230, param);
+ PL_Private_Use = sv_dup_inc(proto_perl->IPrivate_Use, param);
+
#if 0
PL_seen_deprecated_macro = hv_dup_inc(proto_perl->Iseen_deprecated_macro, param);
#endif