mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
It helps a lot when you check for the end of your list before randomly
dereferencing things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42605 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c3a32d190c
commit
8d69b5a113
@ -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