This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Bug in Safe 2.21 re propagating exceptions
authorTim Bunce <Tim.Bunce@pobox.com>
Thu, 11 Feb 2010 10:29:17 +0000 (11:29 +0100)
committerRafael Garcia-Suarez <rgs@consttype.org>
Thu, 11 Feb 2010 10:29:17 +0000 (11:29 +0100)
commit2630fd9e8e31d2fd409e2e8ec16dc85d230a3eb3
tree728a9ee6709d37918522917c61cf1dfaa0195c6d
parent78c4a74a09b8f7ed410a879bd78dfb83cbf7861c
Bug in Safe 2.21 re propagating exceptions

An exception thrown from a closure gets lost.
I've boiled it down to this:

   perl -MSafe -e 'Safe->new->reval(q{sub { die @_ }})->(qq{ok\n})'

That should die with "ok".

The problem is that the closure that wraps any returned code ref if
threads are enabled is acting as an eval block so hiding the exception.
dist/Safe/Safe.pm
dist/Safe/t/safesort.t