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).
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;