mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Fixed bug in FoldingSetIteratorImpl where we did not correctly check if
we had reached the "fake bucket" after the last bucket, allowing the iterator in some cases to run off the end of the hashtable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47178 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
53c607f562
commit
e3e09574ae
@ -326,7 +326,8 @@ FoldingSetImpl::Node *FoldingSetImpl::GetOrInsertNode(FoldingSetImpl::Node *N) {
|
||||
|
||||
FoldingSetIteratorImpl::FoldingSetIteratorImpl(void **Bucket) {
|
||||
// Skip to the first non-null non-self-cycle bucket.
|
||||
while (*Bucket == 0 || GetNextPtr(*Bucket) == 0)
|
||||
while (*Bucket != reinterpret_cast<void*>(-1) &&
|
||||
(*Bucket == 0 || GetNextPtr(*Bucket) == 0))
|
||||
++Bucket;
|
||||
|
||||
NodePtr = static_cast<FoldingSetNode*>(*Bucket);
|
||||
@ -345,7 +346,8 @@ void FoldingSetIteratorImpl::advance() {
|
||||
// Skip to the next non-null non-self-cycle bucket.
|
||||
do {
|
||||
++Bucket;
|
||||
} while (*Bucket == 0 || GetNextPtr(*Bucket) == 0);
|
||||
} while (*Bucket != reinterpret_cast<void*>(-1) &&
|
||||
(*Bucket == 0 || GetNextPtr(*Bucket) == 0));
|
||||
|
||||
NodePtr = static_cast<FoldingSetNode*>(*Bucket);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user