projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3a32d1
)
It helps a lot when you check for the end of your list before randomly
author
Daniel Berlin
<dberlin@dberlin.org>
Thu, 4 Oct 2007 05:29:36 +0000
(
05:29
+0000)
committer
Daniel Berlin
<dberlin@dberlin.org>
Thu, 4 Oct 2007 05:29:36 +0000
(
05:29
+0000)
dereferencing things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42605
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/SparseBitVector.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/SparseBitVector.h
b/include/llvm/ADT/SparseBitVector.h
index d1e91250680deb7bb603872e7aef30b415ce90dd..b02eb3e48059762f89c412ca632ba7b67ce582b7 100644
(file)
--- a/
include/llvm/ADT/SparseBitVector.h
+++ b/
include/llvm/ADT/SparseBitVector.h
@@
-538,7
+538,8
@@
public:
// We may have hit the beginning of our SparseBitVector, in which case,
// we may need to insert right after this element, which requires moving
// the current iterator forward one, because insert does insert before.
- if (ElementIter->index() < ElementIndex)
+ if (ElementIter != Elements.end() &&
+ ElementIter->index() < ElementIndex)
ElementIter = Elements.insert(++ElementIter, Element);
else
ElementIter = Elements.insert(ElementIter, Element);