mirror of
https://github.com/ruby/ruby.git
synced 2025-09-19 02:23:59 +02:00
merge revision(s) 61517: [Backport #14259]
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/branches/ruby_2_5@61629 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
311d499f5e
commit
a697c8b61b
3 changed files with 9 additions and 2 deletions
4
bignum.c
4
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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue