[libmath-prime-util-perl] 67/181: don't set global SP to itself after vcallsubn

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:51:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

ppm-guest pushed a commit to annotated tag v0.36
in repository libmath-prime-util-perl.

commit e1e4923c36b2d190eddac1e8c360512e307a5af3
Author: bulk88 <bulk88 at hotmail.com>
Date:   Mon Dec 30 12:10:05 2013 -0500

    don't set global SP to itself after vcallsubn
    
    the call_pv will already have moved/set global SP ahead of the PUSHMARK
    position, so don't take the number of items put on the stack, then add
    items to the mark then assign to global SP
---
 XS.xs | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/XS.xs b/XS.xs
index 496a7a7..4794e50 100644
--- a/XS.xs
+++ b/XS.xs
@@ -501,7 +501,8 @@ factor(IN SV* svn)
         }
       }
     } else {
-      XSRETURN(_vcallsubn(aTHX_ GIMME_V, "Math::Prime::Util::_generic_factor", 1));
+      _vcallsubn(aTHX_ GIMME_V, "Math::Prime::Util::_generic_factor", 1);
+      return; /* skip implicit PUTBACK */
     }
 
 
@@ -519,7 +520,8 @@ znorder(IN SV* sva, IN SV* svn)
       if (order == 0) XSRETURN_UNDEF;
       XSRETURN_UV(order);
     }
-    XSRETURN( _vcallsubn(aTHX_ G_SCALAR, "Math::Prime::Util::_generic_znorder", 2) );
+    _vcallsubn(aTHX_ G_SCALAR, "Math::Prime::Util::_generic_znorder", 2);
+    return; /* skip implicit PUTBACK */
 
 void
 znprimroot(IN SV* svn)
@@ -555,7 +557,8 @@ kronecker(IN SV* sva, IN SV* svb)
       IV b = my_sviv(svb);
       XSRETURN_IV( kronecker_ss(a, b) );
     }
-    XSRETURN(_vcallsubn(aTHX_ G_SCALAR, "Math::Prime::Util::_generic_kronecker", 2));
+    _vcallsubn(aTHX_ G_SCALAR, "Math::Prime::Util::_generic_kronecker", 2);
+    return; /* skip implicit PUTBACK */
 
 double
 _XS_ExponentialIntegral(IN SV* x)
@@ -592,7 +595,8 @@ euler_phi(IN SV* svlo, ...)
         UV lo = my_svuv(svlo);
         XSRETURN_UV(totient(lo));
       } else {
-        XSRETURN( _vcallsubn(aTHX_ G_SCALAR, "Math::Prime::Util::_generic_euler_phi", 1) );
+        _vcallsubn(aTHX_ G_SCALAR, "Math::Prime::Util::_generic_euler_phi", 1);
+        return; /* skip implicit PUTBACK */
       }
     } else if (items == 2) {
       SV* svhi = ST(1);
@@ -617,7 +621,8 @@ euler_phi(IN SV* svlo, ...)
           Safefree(totients);
         }
       } else {
-        XSRETURN( _vcallsubn(aTHX_ G_ARRAY, "Math::Prime::Util::_generic_euler_phi", 2) );
+        _vcallsubn(aTHX_ G_ARRAY, "Math::Prime::Util::_generic_euler_phi", 2);
+        return; /* skip implicit PUTBACK */
       }
     } else {
       croak("Usage: euler_phi(n) or euler_phi(1o,hi)");
@@ -632,7 +637,8 @@ moebius(IN SV* svlo, ...)
         UV n = my_svuv(svlo);
         XSRETURN_IV(moebius(n));
       } else {
-        XSRETURN(_vcallsubn(aTHX_ G_SCALAR, "Math::Prime::Util::_generic_moebius",1));
+        _vcallsubn(aTHX_ G_SCALAR, "Math::Prime::Util::_generic_moebius",1);
+        return; /* skip implicit PUTBACK */
       }
     } else if (items == 2) {
       SV* svhi = ST(1);
@@ -653,7 +659,8 @@ moebius(IN SV* svlo, ...)
           Safefree(mu);
         }
       } else {
-        XSRETURN(_vcallsubn(aTHX_ G_ARRAY, "Math::Prime::Util::_generic_moebius",2));
+        _vcallsubn(aTHX_ G_ARRAY, "Math::Prime::Util::_generic_moebius",2);
+        return; /* skip implicit PUTBACK */
       }
     } else {
       croak("Usage: moebius(n) or moebius(1o,hi)");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git



More information about the Pkg-perl-cvs-commits mailing list