summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-13 17:27:40 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-13 17:27:40 +0000
commit98b7080d2a5363ea422ba7111a0f9fa9a6966ac2 (patch)
tree42c1415926e237ff8e499d526c921e5f6466bdc0
parent356d61050c95af7b25fc844ad2125cc3eced4f06 (diff)
* numeric.c (int_pow): wrong overflow detection. [ruby-dev:31215]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--numeric.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b08618c2be..efc83b0580 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,9 @@
-Sat Jul 14 01:44:39 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
+Sat Jul 14 02:25:48 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* numeric.c (int_pow): wrong overflow detection. [ruby-dev:31213]
+ * numeric.c (int_pow): wrong overflow detection. [ruby-dev:31215]
+
Fri Jul 13 16:10:00 2007 Tanaka Akira <akr@fsij.org>
* lib/open-uri.rb (URI::Generic#find_proxy): use ENV.to_hash to access
diff --git a/numeric.c b/numeric.c
index c4210279a4..2dc1dd18bf 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2196,7 +2196,7 @@ int_pow(x, y)
do {
while (y % 2 == 0) {
long x2 = x * x;
- if (x2 < x || !POSFIXABLE(x2)) {
+ if (x2/x != x || !POSFIXABLE(x2)) {
VALUE v;
bignum:
v = rb_big_pow(rb_int2big(x), LONG2NUM(y));