diff options
author | Karl Williamson <khw@cpan.org> | 2019-11-24 20:48:54 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-11-26 19:38:14 -0700 |
commit | a8def808210e08cea0b7889fea7c5146b21af4ed (patch) | |
tree | 40bd3017953f36bf853b7dec6c07e818d1d3588e /intrpvar.h | |
parent | e4b61f959ac649d109da4ede1fba8cfa793a79a4 (diff) | |
download | perl-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.
Diffstat (limited to 'intrpvar.h')
-rw-r--r-- | intrpvar.h | 35 |
1 files changed, 35 insertions, 0 deletions
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. */ |