From: Nicholas Clark Date: Sat, 18 Feb 2006 19:01:48 +0000 (+0000) Subject: save_re_context() and even errsv_save = newSVsv(ERRSV); can turn X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dc0c6abb4831ca4f92936b3f2d60d8c6cf65c6f1;p=p5sagit%2Fp5-mst-13.2.git save_re_context() and even errsv_save = newSVsv(ERRSV); can turn PL_tainted back on, so defer turning if off as late as possible. This gets lib/locale.t working once more. p4raw-id: //depot/perl@27222 --- diff --git a/utf8.c b/utf8.c index 9dc57a2..1ab15cc 100644 --- a/utf8.c +++ b/utf8.c @@ -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))