summaryrefslogtreecommitdiff
path: root/ext/XS-APItest
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-06-09 17:11:06 +0100
committerDavid Mitchell <davem@iabyn.com>2015-06-19 08:44:18 +0100
commit7051b8c3d4558ca104e4fd0a9b39141e79a8e67c (patch)
tree8a1c080b7978cd78cd9903dbd8dca7cec41b9720 /ext/XS-APItest
parenta1f85fba6cf7499b0b79f72dea735d683ee0c946 (diff)
downloadperl-7051b8c3d4558ca104e4fd0a9b39141e79a8e67c.tar.gz
pp_leaveeval: use EVAL_KEEPERR
In order shortly to allow pp_return to tail call pp_leaveval, make pp_leaveval use the EVAL_KEEPERR flag bit of PL_in_eval to decide whether to call CLEAR_ERRSV() rather than testing the OPf_SPECIAL flag bit on the OP_LEAVEEVAL op (since we may no longer be that op). The two are equivalent (I checked this by running test test suite with an assert that they were the same). Note that pp_return already uses the EVAL_KEEPERR flag test, so this commit makes the pp_return and pp_leavesub code blocks more similar. I've also added some more tests, as I initially got the logic of this wrong, and no core tests failed - only cpan/ ones. In particular, no core tests checked whether eval-string actually cleared $@ on success!
Diffstat (limited to 'ext/XS-APItest')
-rw-r--r--ext/XS-APItest/t/call.t4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/XS-APItest/t/call.t b/ext/XS-APItest/t/call.t
index bc78be1920..df98b1a55f 100644
--- a/ext/XS-APItest/t/call.t
+++ b/ext/XS-APItest/t/call.t
@@ -11,7 +11,7 @@ use strict;
BEGIN {
require '../../t/test.pl';
- plan(437);
+ plan(455);
use_ok('XS::APItest')
};
@@ -224,6 +224,8 @@ my @bodies = (
[ 'BEGIN { die "die in BEGIN"}', 0, 0, 1, qr/die in BEGIN/, ],
# run-time exception
[ 'd', 1, 0, 0, qr/its_dead_jim/, ],
+ # success with caught exception
+ [ 'eval { die "blah" }; 99', 0, 1, 1, qr/^$/, ],
);