summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-01 06:07:00 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-01 06:07:00 +0000
commitd775746ed34297f91b6e0a289bb9a525d1b3ccba (patch)
tree3492b10aa2fa28617219efc8f52efeaa2ec37676 /mg.c
parentd1edabcfc0953113eff6d4bda774297dc66644b9 (diff)
downloadperl-d775746ed34297f91b6e0a289bb9a525d1b3ccba.tar.gz
fix segfault on C<local ${^WARNING_BITS}>
p4raw-id: //depot/perl@5394
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mg.c b/mg.c
index 4fe40a1c45..904381a069 100644
--- 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 ;