diff options
author | NARUSE, Yui <naruse@airemix.jp> | 2021-04-02 12:31:08 +0900 |
---|---|---|
committer | NARUSE, Yui <naruse@airemix.jp> | 2021-04-02 12:31:08 +0900 |
commit | 855401da495117fcf5d258fe43b71010abc43d9a (patch) | |
tree | 1689495e77d7cb94cd09ef989ac6950e0d3e70e9 /enum.c | |
parent | 1a47de64f44da6d4339ba8b2c5220eeaba82954c (diff) |
merge revision(s) a85ed626f18d1014d09fb37eb0a703976c3d2b53: [Backport #17731]
Fix Enumerable#inject with high negative fixnums [Bug #17731]
---
enum.c | 2 +-
test/ruby/test_enum.rb | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
Diffstat (limited to 'enum.c')
-rw-r--r-- | enum.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -805,7 +805,7 @@ ary_inject_op(VALUE ary, VALUE init, VALUE op) if (FIXNUM_P(e)) { n += FIX2LONG(e); /* should not overflow long type */ if (!FIXABLE(n)) { - v = rb_big_plus(ULONG2NUM(n), v); + v = rb_big_plus(LONG2NUM(n), v); n = 0; } } |