summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-04-12 15:51:58 +0000
committerNicholas Clark <nick@ccl4.org>2007-04-12 15:51:58 +0000
commitbefad5d1180ef6841306dc0157ceec55281184c9 (patch)
tree97e99967533274641b4bca42b6539edf4c17238b /pp.c
parent53f8fa14c737bb48a330a8a3ea98cf8b4a81073a (diff)
downloadperl-befad5d1180ef6841306dc0157ceec55281184c9.tar.gz
Change 18797 (Patch for [perl #9402], known also as "glibc _moddi3 bug
with negative quads", or also as RedHat bug #65612.) was a bit brute force. In reality, we don't need to have an auto-detecting pp_i_modulo unless we're compiled with 64 bit IVs and on glibc. p4raw-id: //depot/perl@30931
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/pp.c b/pp.c
index 8d53497b68..3df0209e87 100644
--- a/pp.c
+++ b/pp.c
@@ -2566,8 +2566,12 @@ PP(pp_i_divide)
}
}
+#if defined(__GLIBC__) && IVSIZE == 8
STATIC
PP(pp_i_modulo_0)
+#else
+PP(pp_i_modulo)
+#endif
{
/* This is the vanilla old i_modulo. */
dVAR; dSP; dATARGET; tryAMAGICbin(modulo,opASSIGN);
@@ -2587,6 +2591,7 @@ PP(pp_i_modulo_0)
#if defined(__GLIBC__) && IVSIZE == 8
STATIC
PP(pp_i_modulo_1)
+
{
/* This is the i_modulo with the workaround for the _moddi3 bug
* in (at least) glibc 2.2.5 (the PERL_ABS() the workaround).
@@ -2604,7 +2609,6 @@ PP(pp_i_modulo_1)
RETURN;
}
}
-#endif
PP(pp_i_modulo)
{
@@ -2624,7 +2628,6 @@ PP(pp_i_modulo)
* opcode dispatch table if that is the case, remembering to
* also apply the workaround so that this first round works
* right, too. See [perl #9402] for more information. */
-#if defined(__GLIBC__) && IVSIZE == 8
{
IV l = 3;
IV r = -10;
@@ -2640,7 +2643,6 @@ PP(pp_i_modulo)
right = PERL_ABS(right);
}
}
-#endif
/* avoid FPE_INTOVF on some platforms when left is IV_MIN */
if (right == -1)
SETi( 0 );
@@ -2649,6 +2651,7 @@ PP(pp_i_modulo)
RETURN;
}
}
+#endif
PP(pp_i_add)
{