[clang] Don't crash when loading invalid VFS for the module dep collector

The VFS is null when it's invalid so return early in collectVFSFromYAML.
This commit is contained in:
Alex Lorenz
2021-04-26 17:01:51 -07:00
parent 7416a011e2
commit dc392ad681

View File

@@ -2127,6 +2127,8 @@ void vfs::collectVFSFromYAML(std::unique_ptr<MemoryBuffer> Buffer,
std::unique_ptr<RedirectingFileSystem> VFS = RedirectingFileSystem::create(
std::move(Buffer), DiagHandler, YAMLFilePath, DiagContext,
std::move(ExternalFS));
if (!VFS)
return;
ErrorOr<RedirectingFileSystem::LookupResult> RootResult =
VFS->lookupPath("/");
if (!RootResult)