mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-04 03:06:28 +00:00
It helps a lot when you check for the end of your list before randomly
dereferencing things. llvm-svn: 42605
This commit is contained in:
parent
a4df074d31
commit
cd14e3d42a
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user