From a4d51c47f3ff7e09a21ba35c257976b4d09a7bbe Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 19 Apr 2019 10:56:48 -0600 Subject: [PATCH] regcomp.c: Copy some safeguards from swash_init() Moving \p{user-defined} into core C code instead of utf8_heavy.pl removes it from using swash_init(), instead calling the user sub directly. At the suggestion of Tony Cook, this commit cargo cults some precautions that swash_init() did before calling utf8_heavy (which in turn called the user sub). Some of these make sense, but some we're doing because swash_init() did, and presumably it had reasons to. (git blame doesn't really help). --- regcomp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/regcomp.c b/regcomp.c index 150e9a9..fbd5c18 100644 --- a/regcomp.c +++ b/regcomp.c @@ -23247,6 +23247,16 @@ Perl_parse_uniprop_string(pTHX_ XPUSHs(boolSV(to_fold)); PUTBACK; + /* The following block was taken from swash_init(). Presumably + * they apply to here as well, though we no longer use a swash -- + * khw */ + SAVEHINTS(); + save_re_context(); + /* We might get here via a subroutine signature which uses a utf8 + * parameter name, at which point PL_subname will have been set + * but not yet used. */ + save_item(PL_subname); + (void) call_sv(user_sub_sv, G_EVAL|G_SCALAR); SPAGAIN; -- 1.8.3.1