From: Nicholas Clark <nick@ccl4.org>
Date: Sun, 29 Nov 2009 16:42:42 +0000 (+0000)
Subject: Fix RT #70862 by converting ERRSV to GvSVn() to ensure a non-NULL GvSV().
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f5fa9033b8c1fdcbd7710850b3b0380d6b937853;p=p5sagit%2Fp5-mst-13.2.git

Fix RT #70862 by converting ERRSV to GvSVn() to ensure a non-NULL GvSV().
---

diff --git a/perl.h b/perl.h
index bf49279..2f02ba4 100644
--- a/perl.h
+++ b/perl.h
@@ -1310,7 +1310,7 @@ EXTERN_C char *crypt(const char *, const char *);
 #   define SS_NORMAL  		0
 #endif
 
-#define ERRSV GvSV(PL_errgv)
+#define ERRSV GvSVn(PL_errgv)
 #ifdef PERL_CORE
 # define DEFSV (0 + GvSVn(PL_defgv))
 #else
diff --git a/t/op/eval.t b/t/op/eval.t
index 071b2fa..4daf0b9 100644
--- a/t/op/eval.t
+++ b/t/op/eval.t
@@ -6,7 +6,7 @@ BEGIN {
     require './test.pl';
 }
 
-print "1..99\n";
+print "1..101\n";
 
 eval 'print "ok 1\n";';
 
@@ -557,3 +557,18 @@ $test++;
     print "ok $test - RT 63110\n";
     $test++;
 }
+
+curr_test($test);
+
+fresh_perl_is(<<'EOP', "ok\n", undef, 'RT #70862');
+$::{'@'}='';
+eval {};
+print "ok\n";
+EOP
+
+fresh_perl_is(<<'EOP', "ok\n", undef, 'variant of RT #70862');
+eval {
+    $::{'@'}='';
+};
+print "ok\n";
+EOP