This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make the XSRETURN macro evaluate its argument only once.
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sat, 13 Dec 2003 16:33:46 +0000 (16:33 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sat, 13 Dec 2003 16:33:46 +0000 (16:33 +0000)
p4raw-id: //depot/perl@21891

XSUB.h

diff --git a/XSUB.h b/XSUB.h
index ce76a7b..4a1079f 100644 (file)
--- a/XSUB.h
+++ b/XSUB.h
@@ -193,7 +193,8 @@ C<xsubpp>.  See L<perlxs/"The VERSIONCHECK: Keyword">.
 
 #define XSRETURN(off)                                  \
     STMT_START {                                       \
-       PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
+       IV tmpXSoff = (off);                            \
+       PL_stack_sp = PL_stack_base + ax + (tmpXSoff - 1);      \
        return;                                         \
     } STMT_END