Skip to content

Commit

Permalink
[clangd] Fix case mismatch crash on in CDB on windows after 92dd077
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-mccall committed Dec 23, 2020
1 parent 45a4f34 commit 74b3ace
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions clang-tools-extra/clangd/GlobalCompilationDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,14 @@ void DirectoryBasedGlobalCompilationDatabase::broadcastCDB(
// Given that we know that CDBs have been moved/generated, don't trust caches.
// (This should be rare, so it's OK to add a little latency).
constexpr auto IgnoreCache = std::chrono::steady_clock::time_point::max();
for (DirectoryCache *Dir : getDirectoryCaches(FileAncestors)) {
auto DirectoryCaches = getDirectoryCaches(FileAncestors);
assert(DirectoryCaches.size() == FileAncestors.size());
for (unsigned I = 0; I < DirectoryCaches.size(); ++I) {
bool ShouldBroadcast = false;
if (Dir->get(Opts.TFS, ShouldBroadcast, /*FreshTime=*/IgnoreCache,
/*FreshTimeMissing=*/IgnoreCache))
DirectoryHasCDB.find(Dir->Path)->setValue(true);
if (DirectoryCaches[I]->get(Opts.TFS, ShouldBroadcast,
/*FreshTime=*/IgnoreCache,
/*FreshTimeMissing=*/IgnoreCache))
DirectoryHasCDB.find(FileAncestors[I])->setValue(true);
}

std::vector<std::string> GovernedFiles;
Expand Down

0 comments on commit 74b3ace

Please sign in to comment.