summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embed.fnc1
-rw-r--r--embed.h3
-rw-r--r--proto.h1
-rw-r--r--regcomp.c30
-rw-r--r--regexec.c9
5 files changed, 24 insertions, 20 deletions
diff --git a/embed.fnc b/embed.fnc
index 478e7485cc..3510fed976 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -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 \
diff --git a/embed.h b/embed.h
index 6ef726602d..481bdac9bc 100644
--- a/embed.h
+++ b/embed.h
@@ -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)
diff --git a/proto.h b/proto.h
index 7a71622edf..f5793cc892 100644
--- a/proto.h
+++ b/proto.h
@@ -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)
diff --git a/regcomp.c b/regcomp.c
index 236cb243aa..df563508e1 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -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();
}
}
diff --git a/regexec.c b/regexec.c
index d4a7fdd3a8..32c446fd6e 100644
--- a/regexec.c
+++ b/regexec.c
@@ -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