From 8180cf65a5b9fc41ba402a2d08cf62f70af65aeb Mon Sep 17 00:00:00 2001 From: Daniel Berlin Date: Mon, 17 Sep 2007 18:04:21 +0000 Subject: Fix iterator so it doesn't sometimes report bits that aren't in the bitmap git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42039 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/SparseBitVector.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/llvm/ADT/SparseBitVector.h b/include/llvm/ADT/SparseBitVector.h index 6ffc6ed..3455f51 100644 --- a/include/llvm/ADT/SparseBitVector.h +++ b/include/llvm/ADT/SparseBitVector.h @@ -405,6 +405,8 @@ class SparseBitVector { WordNumber = (NextSetBitNumber % ElementSize) / BITWORD_SIZE; Bits = Iter->word(WordNumber); Bits >>= NextSetBitNumber % BITWORD_SIZE; + BitNumber = Iter->index() * ElementSize; + BitNumber += NextSetBitNumber; } } } -- cgit v1.1