diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | numeric.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Mon May 30 10:26:51 2011 NARUSE, Yui <naruse@ruby-lang.org> + + * numeric.c (int_pow): make sure to assign the result of x * z. + If xz is optimized out, the value won't overflow. + Sun May 29 23:17:29 2011 NARUSE, Yui <naruse@ruby-lang.org> * re.c (rb_reg_match): fix rdoc of Regexp#=~. @@ -2637,7 +2637,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; } |