diff options
Diffstat (limited to 'llvm/lib/CAS')
| -rw-r--r-- | llvm/lib/CAS/ObjectStore.cpp | 5 | ||||
| -rw-r--r-- | llvm/lib/CAS/UnifiedOnDiskCache.cpp | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CAS/ObjectStore.cpp b/llvm/lib/CAS/ObjectStore.cpp index 3110577..c3f7a0c 100644 --- a/llvm/lib/CAS/ObjectStore.cpp +++ b/llvm/lib/CAS/ObjectStore.cpp @@ -213,10 +213,13 @@ Expected<ObjectRef> ObjectStore::importObject(ObjectStore &Upstream, // Remove the current node and its IDs from the stack. PrimaryRefStack.truncate(PrimaryRefStack.size() - Cur.RefsCount); - CursorStack.pop_back(); + // Push new node into created objects. PrimaryRefStack.push_back(*NewNode); CreatedObjects.try_emplace(Cur.Ref, *NewNode); + + // Pop the cursor in the end after all uses. + CursorStack.pop_back(); continue; } diff --git a/llvm/lib/CAS/UnifiedOnDiskCache.cpp b/llvm/lib/CAS/UnifiedOnDiskCache.cpp index ae9d818..7b790bb 100644 --- a/llvm/lib/CAS/UnifiedOnDiskCache.cpp +++ b/llvm/lib/CAS/UnifiedOnDiskCache.cpp @@ -174,7 +174,7 @@ getAllDBDirs(StringRef Path, bool IncludeCorrupt = false) { return createFileError(Path, EC); llvm::sort(FoundDBDirs, [](const DBDir &LHS, const DBDir &RHS) -> bool { - return LHS.Order <= RHS.Order; + return LHS.Order < RHS.Order; }); SmallVector<std::string, 4> DBDirs; |
