This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Carp.pm localise $SIG{__DIE__} before eval
authorFather Chrysostomos <sprout@cpan.org>
Fri, 16 Dec 2011 06:07:06 +0000 (22:07 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 16 Dec 2011 06:09:34 +0000 (22:09 -0800)
Otherwise we end up calling other code’s $SIG{__DIE__}.

dist/Carp/lib/Carp.pm

index cd9eb87..c08af19 100644 (file)
@@ -289,6 +289,7 @@ sub ret_backtrace {
     $mess = "$err at $i{file} line $i{line}$tid_msg";
     if( defined $. ) {
         local $@ = '';
+        local $SIG{__DIE__};
         eval {
             die;
         };