File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change
1
+ Wed Aug 22 10:29:45 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
2
+
3
+ * bignum.c (rb_big_pow): refine overflow check. [ruby-dev:31242]
4
+
1
5
Wed Aug 22 10:26:59 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
2
6
3
7
* time.c (time_succ): Time#succ should return a time object in the
Original file line number Diff line number Diff line change @@ -1646,8 +1646,10 @@ rb_big_pow(x, y)
1646
1646
yy = FIX2LONG (y );
1647
1647
if (yy > 0 ) {
1648
1648
VALUE z = x ;
1649
+ const long BIGLEN_LIMIT = 1024 * 1024 / SIZEOF_BDIGITS ;
1649
1650
1650
- if (RBIGNUM (x )-> len * SIZEOF_BDIGITS * yy > 1024 * 1024 ) {
1651
+ if ((RBIGNUM (x )-> len > BIGLEN_LIMIT ) ||
1652
+ (RBIGNUM (x )-> len > BIGLEN_LIMIT / yy )) {
1651
1653
rb_warn ("in a**b, b may be too big" );
1652
1654
d = (double )yy ;
1653
1655
break ;
Original file line number Diff line number Diff line change 2
2
#define RUBY_RELEASE_DATE "2007-08-22"
3
3
#define RUBY_VERSION_CODE 186
4
4
#define RUBY_RELEASE_CODE 20070822
5
- #define RUBY_PATCHLEVEL 69
5
+ #define RUBY_PATCHLEVEL 70
6
6
7
7
#define RUBY_VERSION_MAJOR 1
8
8
#define RUBY_VERSION_MINOR 8
You can’t perform that action at this time.
0 commit comments