In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/aee674b7db1a4a3fd0082f4247560d3c945d0f5c?hp=ef4abe7673cc0b19ffd81c9a42f79de20a52ac87>

- Log -----------------------------------------------------------------
commit aee674b7db1a4a3fd0082f4247560d3c945d0f5c
Author: Nicholas Clark <[email protected]>
Date:   Fri Apr 5 12:12:53 2013 +0200

    Test that caller does not SEGV when the current package is undefined.
    
    Prior to commit d4d03940c58a0177 this code would SEGV under ithreads.
    Test suggested by Brian Fraser.
-----------------------------------------------------------------------

Summary of changes:
 t/op/caller.t |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/t/op/caller.t b/t/op/caller.t
index efce8df..c37a6ed 100644
--- a/t/op/caller.t
+++ b/t/op/caller.t
@@ -5,7 +5,7 @@ BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
     require './test.pl';
-    plan( tests => 91 );
+    plan( tests => 92 );
 }
 
 my @c;
@@ -297,6 +297,14 @@ is eval "s//<<END/e;\nfoo\nEND\n(caller 0)[6]",
  is $w, 1, 'value from (caller 0)[9] (bitmask) works in ${^WARNING_BITS}';
 }
 
+# This was fixed with commit d4d03940c58a0177, which fixed bug #78742
+fresh_perl_is <<'END', "__ANON__::doof\n", {},
+package foo;
+BEGIN {undef %foo::}
+sub doof { caller(0) }
+print +(doof())[3];
+END
+    "caller should not SEGV when the current package is undefined";
 $::testing_caller = 1;
 
 do './op/caller.pl' or die $@;

--
Perl5 Master Repository

Reply via email to