This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make die reliably hand error to post-eval code
authorZefram <zefram@fysh.org>
Tue, 20 Apr 2010 20:32:53 +0000 (21:32 +0100)
committerZefram <zefram@fysh.org>
Tue, 20 Apr 2010 23:06:13 +0000 (00:06 +0100)
commit96d9b9cd40f1d98fda790eb12b5cdbeef8b48a81
tree831956f1da7b8d410d9f54fb160c5f6c9eaa4f53
parent157ebcf587b4b84c105e6157097a480172b5079d
make die reliably hand error to post-eval code

Put the exception into $@ last thing before longjmping to the op following
the eval block, where previously it went into $@ before unwinding the
stack.  This change means that the exception is not liable to be lost
by $@ being clobbered by destructors, cleanup code, or restoration after
"local $@".  The code running immediately after eval can now rely on $@
accurately indicating the exception status of the eval.
MANIFEST
pp_ctl.c
t/op/die_except.t [new file with mode: 0644]
t/op/eval.t