aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-30 14:50:15 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-30 14:50:15 +0000
commitf92924923dd4d707abc8bf431d3c3e746fd8515a (patch)
tree6226b6d892535ca9a79beecd7f24bc8636ba302d /bignum.c
parentd83e02017ec2e04da5e3b6c5921f029f80494980 (diff)
downloadruby-f92924923dd4d707abc8bf431d3c3e746fd8515a.tar.gz
numeric.c: Fix Integer#pow with a large Fixnum modulo
* numeric.c: Fix Integer#pow with a large Fixnum modulo [Bug #14259] [ruby-core:84562] * test/ruby/test_numeric.rb: add assertions for reproducing this bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index 148276743f..7ffb798e5e 100644
--- a/bignum.c
+++ b/bignum.c
@@ -7016,7 +7016,9 @@ int_pow_tmp2(VALUE x, VALUE y, long mm, int nega_flg)
xx = MUL_MODULO(xx, xx, m);
}
-#ifndef DLONG
+#ifdef DLONG
+ tmp = tmp2;
+#else
tmp = FIX2LONG(tmp2);
#endif
if (nega_flg && tmp) {