summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-10-16 13:31:57 +0100
committerDavid Mitchell <davem@iabyn.com>2016-02-03 08:59:45 +0000
commit2aabfe8a6165874dd6373e006f0e80d74d5f602c (patch)
treea4cb777b2e646096a6e15276ba67a52a1945724d /ext
parent9aba0c93f90eae29f42bd1b63c0079b8c7f4e364 (diff)
downloadperl-2aabfe8a6165874dd6373e006f0e80d74d5f602c.tar.gz
pp_leaveeval: reset stack in VOID context
$ perl -Dst -e'eval"1"' Gives: .... ((eval 1):1) leaveeval => (FREED) Change it so that like all the other pp_leavefoo() functions, it does if (gimme == G_VOID) PL_stack_sp = newsp; I can't think of any (non-debugging) perl-level badness the old behaviour can be shown to demonstrate, but best not to have freed values left dangling. This also allows pp_leaveeval() to (like the other pp_leavefoo functions) avoid doing a dSP with the associated unnecessary PUTBACKs and SPAGAINs. Finally, the code to detect a false require is moved to earlier in the function where it's in the same place as the rest of the stack arg processing code.
Diffstat (limited to 'ext')
-rw-r--r--ext/XS-APItest/t/call.t8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/XS-APItest/t/call.t b/ext/XS-APItest/t/call.t
index df98b1a55f..c474639380 100644
--- a/ext/XS-APItest/t/call.t
+++ b/ext/XS-APItest/t/call.t
@@ -81,7 +81,9 @@ for my $test (
"$description call_pv('f')");
ok(eq_array( [ eval_sv('f(' . join(',',map"'$_'",@$args) . ')', $flags) ],
- $expected), "$description eval_sv('f(args)')");
+ $flags == G_VOID ? [ 0 ] : $expected
+ ),
+ "$description eval_sv('f(args)')");
ok(eq_array( [ call_method('meth', $flags, $obj, @$args) ], $expected),
"$description call_method('meth')");
@@ -135,7 +137,9 @@ for my $test (
$expected), "$description G_NOARGS call_pv('f')");
ok(eq_array( [ sub { eval_sv('f(@_)', $flags|G_NOARGS) }->(@$args) ],
- $expected), "$description G_NOARGS eval_sv('f(@_)')");
+ $flags == G_VOID ? [ 0 ] : $expected
+ ),
+ "$description G_NOARGS eval_sv('f(@_)')");
# XXX call_method(G_NOARGS) isn't tested: I'm assuming
# it's not a sensible combination. DAPM.