summaryrefslogtreecommitdiff
path: root/lib/ExtUtils/xsubpp
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>2003-08-02 23:19:02 -0700
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-12 12:32:29 +0000
commitd8e11c65f67f4b045739b3272eb9c26a8e2379e0 (patch)
tree0d29a9de311620c591ab4a5413e7ce15ef34d6fa /lib/ExtUtils/xsubpp
parent53bb94e2eadb9b74238a21ffe3168f4a80021d3b (diff)
downloadperl-d8e11c65f67f4b045739b3272eb9c26a8e2379e0.tar.gz
xsubpp: wrong code
Message-ID: <20030803131902.GA5146@math.berkeley.edu> p4raw-id: //depot/perl@20650
Diffstat (limited to 'lib/ExtUtils/xsubpp')
-rwxr-xr-xlib/ExtUtils/xsubpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ExtUtils/xsubpp b/lib/ExtUtils/xsubpp
index 647ffd78b5..7ae8020e25 100755
--- a/lib/ExtUtils/xsubpp
+++ b/lib/ExtUtils/xsubpp
@@ -1453,7 +1453,11 @@ EOF
$xsreturn = 1 if $ret_type ne "void";
my $num = $xsreturn;
my $c = @outlist;
- print "\tXSprePUSH;" if $c and not $prepush_done;
+ # (PP)CODE set different values of SP; reset to PPCODE's with 0 output
+ print "\tXSprePUSH;" if $c and not $prepush_done;
+ # Take into account stuff already put on stack
+ print "\t++SP;" if $c and not $prepush_done and $xsreturn;
+ # Now SP corresponds to ST($xsreturn), so one can combine PUSH and ST()
print "\tEXTEND(SP,$c);\n" if $c;
$xsreturn += $c;
generate_output($var_types{$_}, $num++, $_, 0, 1) for @outlist;