Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8235714

BitMap::count_one_bits may count bits beyond unaligned end

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Other
    • Icon: P4 P4
    • 15
    • 14
    • hotspot
    • None

      The BitMap::count_one_bits operation sums the population count of each word in the bitmap, including the last, which might only be partial. If there are set bits beyond that designated by BitMap::size() then the returned count will be wrong.

      Some BitMaps guarantee that the allocated buffer is initially cleared, in which case there won't be any set bits beyond the end. But a BitMapView can be made from some arbitrary buffer, perhaps even a subpart of some other BitMap, where no such guarantee exists.

            kbarrett Kim Barrett
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: