save_re_context() and even errsv_save = newSVsv(ERRSV); can turn
authorNicholas Clark <nick@ccl4.org>
Sat, 18 Feb 2006 19:01:48 +0000 (19:01 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 18 Feb 2006 19:01:48 +0000 (19:01 +0000)
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

utf8.c

diff --git a/utf8.c b/utf8.c
index 9dc57a2..1ab15cc 100644 (file)
--- 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))