mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8272541: Incorrect overflow test in Toom-Cook branch of BigInteger multiplication
Reviewed-by: darcy
This commit is contained in:
parent
dfeb4132e4
commit
d1aeca117c
2 changed files with 27 additions and 12 deletions
|
@ -1670,8 +1670,8 @@ public class BigInteger extends Number implements Comparable<BigInteger> {
|
|||
// are only considering the magnitudes as non-negative. The
|
||||
// Toom-Cook multiplication algorithm determines the sign
|
||||
// at its end from the two signum values.
|
||||
if (bitLength(mag, mag.length) +
|
||||
bitLength(val.mag, val.mag.length) >
|
||||
if ((long)bitLength(mag, mag.length) +
|
||||
(long)bitLength(val.mag, val.mag.length) >
|
||||
32L*MAX_MAG_LENGTH) {
|
||||
reportOverflow();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue