summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-27 08:05:21 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-27 08:05:21 +0000
commitea2cb282aeba0457aa775d5dbfa1da6810fafa45 (patch)
tree5bf06be14447d65bfef7f68b019268ba8a4d683c /numeric.c
parent5d2069cd566a2e1c616a91e4bda82f567d857498 (diff)
* numeric.c (int_pow): bugfix of overflow detection.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index 1425348a95..db847567d0 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2283,7 +2283,7 @@ int_pow(long x, unsigned long y)
}
{
long xz = x * z;
- if (xz < z || xz < x || !POSFIXABLE(xz)) {
+ if (!POSFIXABLE(xz) || xz / x != z) {
goto bignum;
}
z = xz;