diff options
author | Marc-Andre Lafortune <github@marc-andre.ca> | 2021-03-18 23:29:49 -0400 |
---|---|---|
committer | Marc-André Lafortune <github@marc-andre.ca> | 2021-03-19 00:21:41 -0400 |
commit | a85ed626f18d1014d09fb37eb0a703976c3d2b53 (patch) | |
tree | 73727d54be68b75b8b04b4a6446f1ba88ce3f831 /enum.c | |
parent | c576e63ee752f2c7ce865b1cb1398d013d55f153 (diff) |
Fix Enumerable#inject with high negative fixnums [Bug #17731]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4288
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; } } |