Change 20650 by [EMAIL PROTECTED] on 2003/08/12 12:32:29
Subject: [PATCH 5.8.1 @20218] xsubpp: wrong code
From: Ilya Zakharevich <[EMAIL PROTECTED]>
Date: Sun, 3 Aug 2003 06:19:02 -0700
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/perl/lib/ExtUtils/xsubpp#64 edit
Differences ...
==== //depot/perl/lib/ExtUtils/xsubpp#64 (xtext) ====
Index: perl/lib/ExtUtils/xsubpp
--- perl/lib/ExtUtils/xsubpp#63~18270~ Sun Dec 8 16:25:26 2002
+++ perl/lib/ExtUtils/xsubpp Tue Aug 12 05:32:29 2003
@@ -1453,7 +1453,11 @@
$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;
End of Patch.