Skip Menu |

This queue is for tickets about the Scope-Upper CPAN distribution.

Report information
The Basics
Id: 56301
Status: resolved
Priority: 0/
Queue: Scope-Upper

People
Owner: Nobody in particular
Requestors: zefram [...] fysh.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 0.11



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
Le Lun 05 Avr 2010 13:58:31, zefram@fysh.org a écrit : Show quoted text
> 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
Thanks for your report. The context overwrite workaround did have to be used in all cases indeed. I don't really know why I didn't do this in the first place, as Variable::Magic does it right... Anyway, it's fixed in 0.11.