From 234c47e9fba274e1d07bdc39846cb9dbe3db569e Mon Sep 17 00:00:00 2001 From: matz Date: Sun, 9 Apr 2006 16:10:40 +0000 Subject: * prec.c (prec_prec_f): documentation patch from . [ruby-core:07689] * bignum.c (rb_big_pow): second operand may be too big even if it's a Fixnum. [ruby-talk:187984] * README.EXT: update symbol description. [ruby-talk:188104] * COPYING: explicitly note GPLv2. [ruby-talk:187922] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bignum.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bignum.c') diff --git a/bignum.c b/bignum.c index 425676d32c..6a7a83c085 100644 --- a/bignum.c +++ b/bignum.c @@ -1606,6 +1606,11 @@ rb_big_pow(x, y) if (yy > 0) { VALUE z = x; + if (RBIGNUM(x)->len * SIZEOF_BDIGITS * yy > 1024*1024) { + rb_warn("in a**b, b may be too big"); + d = (double)yy; + break; + } for (;;) { yy -= 1; if (yy == 0) break; -- cgit v1.2.3