Re: [perl #15479] perl 5.8.0 segfault
Rafael Garcia-Suarez [Fri, 2 Aug 2002 00:13:10 +0000 (02:13 +0200)]
Message-id: <20020802001310.7e1dc694.rgarciasuarez@free.fr>

p4raw-id: //depot/perl@17695

MANIFEST
perl.h
t/op/stash.t [new file with mode: 0644]

index 43fefba..8fea24d 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -2554,6 +2554,7 @@ t/op/splice.t                     See if splice works
 t/op/split.t                   See if split works
 t/op/sprintf.t                 See if sprintf works
 t/op/srand.t                   See if srand works
+t/op/stash.t                   See if %:: stashes work
 t/op/stat.t                    See if stat works
 t/op/study.t                   See if study works
 t/op/subst.t                   See if substitution works
diff --git a/perl.h b/perl.h
index 9c4a4b9..944dcc7 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -2396,6 +2396,7 @@ Gid_t getegid (void);
 
 #ifndef Perl_error_log
 #  define Perl_error_log       (PL_stderrgv                    \
+                                && isGV(PL_stderrgv)           \
                                 && GvIOp(PL_stderrgv)          \
                                 && IoOFP(GvIOp(PL_stderrgv))   \
                                 ? IoOFP(GvIOp(PL_stderrgv))    \
diff --git a/t/op/stash.t b/t/op/stash.t
new file mode 100644 (file)
index 0000000..c8fe0ae
--- /dev/null
@@ -0,0 +1,18 @@
+#!./perl
+
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = qw(../lib);
+}
+
+require "./test.pl";
+
+plan( tests => 1 );
+
+# Used to segfault (bug #15479)
+fresh_perl_is(
+    '%:: = ""',
+    'Odd number of elements in hash assignment at - line 1.',
+    { switches => [ '-w' ] },
+    'delete $::{STDERR} and print a warning',
+);