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 24c35e8..904381a 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1009,7 +1009,7 @@ Perl_magic_setsig(pTHX_ SV *sv, MAGIC *mg)
     else {
        i = whichsig(s);        /* ...no, a brick */
        if (!i) {
-           if (ckWARN(WARN_SIGNAL) || strEQ(s,"ALARM"))
+           if (ckWARN(WARN_SIGNAL))
                Perl_warner(aTHX_ WARN_SIGNAL, "No such signal: SIG%s", s);
            return 0;
        }
@@ -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 ;
@@ -2175,7 +2180,7 @@ static void
 restore_magic(pTHXo_ void *p)
 {
     dTHR;
-    MGS* mgs = SSPTR((I32)p, MGS*);
+    MGS* mgs = SSPTR(PTR2IV(p), MGS*);
     SV* sv = mgs->mgs_sv;
 
     if (!sv)