diff options
author | Heejong Lee <heejong@gmail.com> | 2013-04-06 01:48:31 +0900 |
---|---|---|
committer | Heejong Lee <heejong@gmail.com> | 2013-04-07 02:11:14 +0900 |
commit | e8c85a37186b65561a3826b9889c9d06a69650da (patch) | |
tree | c76805e6700fd62e44d0435767506cfc8d70cb79 /test/files/run/bitsets.check | |
parent | d301a86488f944ae3a1a14ba578ac8c87e64f01d (diff) | |
download | scala-e8c85a37186b65561a3826b9889c9d06a69650da.tar.gz scala-e8c85a37186b65561a3826b9889c9d06a69650da.tar.bz2 scala-e8c85a37186b65561a3826b9889c9d06a69650da.zip |
SI-7080 improve boundary value checking for BitSet
When BitSet accepts a very large integer such as Int.MaxValue,
integer overflow possibly occurs in the calculation of boundary
value "nwords * WordLength". This faulty boundary condition
causes empty-iterator problem like following:
scala> import collection.mutable.BitSet
import collection.mutable.BitSet
scala> val x = BitSet(Int.MaxValue)
x: scala.collection.mutable.BitSet = BitSet()
scala> x.iterator
res0: Iterator[Int] = empty iterator
Diffstat (limited to 'test/files/run/bitsets.check')
-rw-r--r-- | test/files/run/bitsets.check | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/files/run/bitsets.check b/test/files/run/bitsets.check index 41c2ccdcb8..9bbc769b72 100644 --- a/test/files/run/bitsets.check +++ b/test/files/run/bitsets.check @@ -42,6 +42,10 @@ b2:BitSet(5) b3:BitSet(5, 7) b4:BitSet(7) b0:BitSet(5, 6, 7) +bMax:BitSet(2147483647) +2147483647 +bLarge:BitSet(2000000001) +false is0 = BitSet() is1 = BitSet() is2 = BitSet(2) |