Index: llvm/lib/Support/VirtualFileSystem.cpp =================================================================== --- llvm/lib/Support/VirtualFileSystem.cpp +++ llvm/lib/Support/VirtualFileSystem.cpp @@ -2028,8 +2028,13 @@ if (!Entries.empty()) { const YAMLVFSEntry &Entry = Entries.front(); bool first_entry_is_directory = Entry.IsDirectory; - StringRef Dir = - first_entry_is_directory ? Entry.VPath : path::parent_path(Entry.VPath); + StringRef Dir; + if (first_entry_is_directory) { + Dir = Entry.VPath; + } else { + Dir = path::parent_path(Entry.VPath); + assert(!Dir.empty() && "No parent directory"); + } startDirectory(Dir); StringRef RPath = Entry.RPath;