summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-31 00:13:21 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-31 00:13:21 +0000
commita6cafde27804d0a935212ca8921408ebc35861a6 (patch)
tree04b6f8f2a094905e630f670e3fb68758d1c6e610 /numeric.c
parentd71702168ca57315179441bce49402295b28240c (diff)
merges r31805 from trunk into ruby_1_9_2.
-- * numeric.c (int_pow): make sure to assign the result of x * z. If xz is optimized out, the value won't overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31843 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 4a3efac844..203bef9c65 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2573,7 +2573,7 @@ int_pow(long x, unsigned long y)
y >>= 1;
}
{
- long xz = x * z;
+ volatile long xz = x * z;
if (!POSFIXABLE(xz) || xz / x != z) {
goto bignum;
}