This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
the workaround is needed in all 7.2.* compilers,
[perl5.git] / mg.c
diff --git a/mg.c b/mg.c
index 4fe40a1..904381a 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1719,6 +1719,11 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
        }
        else if (strEQ(mg->mg_ptr, "\027ARNING_BITS")) {
            if ( ! (PL_dowarn & G_WARN_ALL_MASK)) {
+               if (!SvPOK(sv) && PL_localizing) {
+                   sv_setpvn(sv, WARN_NONEstring, WARNsize);
+                   PL_compiling.cop_warnings = WARN_NONE;
+                   break;
+               }
                 if (memEQ(SvPVX(sv), WARN_ALLstring, WARNsize)) {
                    PL_compiling.cop_warnings = WARN_ALL;
                    PL_dowarn |= G_WARN_ONCE ;