diff options
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1592,14 +1592,17 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits ENTER; SAVEI32(PL_hints); PL_hints = 0; - /* It is assumed that callers of this routine are not passing in any - user derived data. */ - SAVEBOOL(PL_tainted); - PL_tainted = 0; save_re_context(); if (!gv_fetchmeth(stash, "SWASHNEW", 8, -1)) { /* demand load utf8 */ ENTER; errsv_save = newSVsv(ERRSV); + /* It is assumed that callers of this routine are not passing in any + user derived data. */ + /* Need to do this after save_re_context() as it will set PL_tainted to + 1 while saving $1 etc (see the code after getrx: in Perl_magic_get). + Even line to create errsv_save can turn on PL_tainted. */ + SAVEBOOL(PL_tainted); + PL_tainted = 0; Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, newSVpvn(pkg,pkg_len), NULL); if (!SvTRUE(ERRSV)) |