In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/1768639d6db2b2e7909706b5250e8751a23d34e1?hp=82b53111b29b7b8060044482d261a31ccd5ac001>
- Log ----------------------------------------------------------------- commit 1768639d6db2b2e7909706b5250e8751a23d34e1 Author: Tony Cook <[email protected]> Date: Wed Jun 5 11:59:17 2019 +1000 (perl #134175) tests for eval_pv rethrowing objects commit 0f4fe36327e6e3c7c0007b67364cac3c4b43ee5d Author: Pali <[email protected]> Date: Tue Jun 4 12:28:09 2019 +0200 In Perl_eval_pv rethrow error via croak_sv() This would allow to rethrow object exceptions. ----------------------------------------------------------------------- Summary of changes: ext/XS-APItest/t/call.t | 7 +++++-- perl.c | 3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/XS-APItest/t/call.t b/ext/XS-APItest/t/call.t index 8192b9bd36..632a421d4f 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(527); + plan(530); use_ok('XS::APItest') }; @@ -223,7 +223,10 @@ is(eval_pv('d()', 0), undef, "eval_pv('d()', 0)"); is($@, "its_dead_jim\n", "eval_pv('d()', 0) - \$@"); is(eval { eval_pv('d()', 1) } , undef, "eval { eval_pv('d()', 1) }"); is($@, "its_dead_jim\n", "eval { eval_pv('d()', 1) } - \$@"); - +is(eval { eval_pv(q/die $obj/, 1) }, undef, + "eval_pv die of an object"); +ok(ref $@, "object thrown"); +is($@, $obj, "check object rethrown"); # #3719 - check that the eval call variants handle exceptions correctly, # and do the right thing with $@, both with and without G_KEEPERR set. diff --git a/perl.c b/perl.c index f2c87f4937..69e3efcd70 100644 --- a/perl.c +++ b/perl.c @@ -3231,8 +3231,7 @@ Perl_eval_pv(pTHX_ const char *p, I32 croak_on_error) if (croak_on_error) { SV * const errsv = ERRSV; if(SvTRUE_NN(errsv)) - /* replace with croak_sv? */ - Perl_croak_nocontext("%s", SvPV_nolen_const(errsv)); + croak_sv(errsv); } return sv; -- Perl5 Master Repository
