diff options
-rw-r--r-- | embed.fnc | 1 | ||||
-rw-r--r-- | embed.h | 3 | ||||
-rw-r--r-- | proto.h | 1 | ||||
-rw-r--r-- | regcomp.c | 30 | ||||
-rw-r--r-- | regexec.c | 9 |
5 files changed, 24 insertions, 20 deletions
@@ -1529,6 +1529,7 @@ ApM |SV* |_get_regclass_nonbitmap_data \ |NN const struct regnode *node|bool doinit \ |NULLOK SV **listsvp \ |NULLOK SV **lonly_utf8_locale +EXp |void|_load_PL_utf8_foldclosures| #endif #if defined(PERL_IN_REGCOMP_C) || defined (PERL_IN_DUMP_C) EXMp |void |_invlist_dump |NN PerlIO *file|I32 level \ @@ -970,6 +970,9 @@ # if defined(PERL_IN_REGCOMP_C) || defined (PERL_IN_DUMP_C) #define _invlist_dump(a,b,c,d) Perl__invlist_dump(aTHX_ a,b,c,d) # endif +# if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) +#define _load_PL_utf8_foldclosures() Perl__load_PL_utf8_foldclosures(aTHX) +# endif # if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C) #define _get_swash_invlist(a) Perl__get_swash_invlist(aTHX_ a) #define _invlist_contains_cp(a,b) S__invlist_contains_cp(aTHX_ a,b) @@ -7025,6 +7025,7 @@ PERL_CALLCONV SV* Perl__get_regclass_nonbitmap_data(pTHX_ const regexp *prog, co #define PERL_ARGS_ASSERT__GET_REGCLASS_NONBITMAP_DATA \ assert(node) +PERL_CALLCONV void Perl__load_PL_utf8_foldclosures(pTHX); #endif #if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C) PERL_CALLCONV SV* Perl__get_swash_invlist(pTHX_ SV* const swash) @@ -9069,6 +9069,23 @@ Perl__invlist_dump(pTHX_ PerlIO *file, I32 level, count += 2; } } + +void +Perl__load_PL_utf8_foldclosures (pTHX) +{ + assert(! PL_utf8_foldclosures); + + /* If the folds haven't been read in, call a fold function + * to force that */ + if (! PL_utf8_tofold) { + U8 dummy[UTF8_MAXBYTES_CASE+1]; + + /* This string is just a short named one above \xff */ + to_utf8_fold((U8*) HYPHEN_UTF8, dummy, NULL); + assert(PL_utf8_tofold); /* Verify that worked */ + } + PL_utf8_foldclosures = _swash_inversion_hash(PL_utf8_tofold); +} #endif #ifdef PERL_ARGS_ASSERT__INVLISTEQ @@ -14316,18 +14333,7 @@ parseit: /* This is a hash that for a particular fold gives all * characters that are involved in it */ if (! PL_utf8_foldclosures) { - - /* If the folds haven't been read in, call a fold function - * to force that */ - if (! PL_utf8_tofold) { - U8 dummy[UTF8_MAXBYTES_CASE+1]; - - /* This string is just a short named one above \xff */ - to_utf8_fold((U8*) HYPHEN_UTF8, dummy, NULL); - assert(PL_utf8_tofold); /* Verify that worked */ - } - PL_utf8_foldclosures - = _swash_inversion_hash(PL_utf8_tofold); + _load_PL_utf8_foldclosures(); } } @@ -3698,14 +3698,7 @@ S_setup_EXACTISH_ST_c1_c2(pTHX_ const regnode * const text_node, int *c1p, /* Load the folds hash, if not already done */ SV** listp; if (! PL_utf8_foldclosures) { - if (! PL_utf8_tofold) { - U8 dummy[UTF8_MAXBYTES_CASE+1]; - - /* Force loading this by folding an above-Latin1 char */ - to_utf8_fold((U8*) HYPHEN_UTF8, dummy, NULL); - assert(PL_utf8_tofold); /* Verify that worked */ - } - PL_utf8_foldclosures = _swash_inversion_hash(PL_utf8_tofold); + _load_PL_utf8_foldclosures(); } /* The fold closures data structure is a hash with the keys |