Subject: | reap loses eval context when dying naturally |
Date: | Mon, 5 Apr 2010 18:57:01 +0100 |
To: | bug-Scope-Upper [...] rt.cpan.org |
From: | Zefram <zefram [...] fysh.org> |
Scope::Upper::reap() works fine when unwinding is due to an explicit
die(), but not when a die occurs for other reasons:
$ perl -MScope::Upper=reap -lwe 'eval { reap { print "reaping" }; print "start"; die "foo"; }; print "done"'
start
reaping
done
$ perl -MScope::Upper=reap -lwe 'eval { reap { print "reaping" }; print "start"; print 0/0; }; print "done"'
start
reaping
panic: restartop
$
I believe this is due to the special handling in su_call(), controlled by
the "dieing" variable, not happening for implicit deaths. The code looks
for OP_DIE, rather than for any of the other features of die processing.
-zefram