File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1818#include <float.h>
1919#endif
2020
21+ #include <limits.h>
2122#include "id.h"
2223#include "internal.h"
2324#include "internal/class.h"
@@ -4008,7 +4009,7 @@ arith_seq_take(VALUE self, VALUE num)
40084009 ary = rb_ary_new_capa ((n < len ) ? n : len );
40094010 while (n > 0 && i < end ) {
40104011 rb_ary_push (ary , LONG2FIX (i ));
4011- if (i + unit < i ) break ;
4012+ if (i > LONG_MAX - unit ) break ;
40124013 i += unit ;
40134014 -- n ;
40144015 }
@@ -4021,7 +4022,7 @@ arith_seq_take(VALUE self, VALUE num)
40214022 ary = rb_ary_new_capa ((n < len ) ? n : len );
40224023 while (n > 0 && i > end ) {
40234024 rb_ary_push (ary , LONG2FIX (i ));
4024- if (i + unit > i ) break ;
4025+ if (i < LONG_MIN - unit ) break ;
40254026 i += unit ;
40264027 -- n ;
40274028 }
You can’t perform that action at this time.
0 commit comments