summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/FoldingSet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/FoldingSet.cpp')
-rw-r--r--llvm/lib/Support/FoldingSet.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Support/FoldingSet.cpp b/llvm/lib/Support/FoldingSet.cpp
index 2d2279cefe5..97d1f0d1689 100644
--- a/llvm/lib/Support/FoldingSet.cpp
+++ b/llvm/lib/Support/FoldingSet.cpp
@@ -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);
}
OpenPOWER on IntegriCloud