fix segfault on C<local ${^WARNING_BITS}>
authorGurusamy Sarathy <gsar@cpan.org>
Wed, 1 Mar 2000 06:07:00 +0000 (06:07 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Wed, 1 Mar 2000 06:07:00 +0000 (06:07 +0000)
p4raw-id: //depot/perl@5394

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 ;