From 72709dcd7a748c683287993235e9ea5fc10ba916 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Thu, 24 Jan 2019 17:53:05 +0200 Subject: [PATCH] Fixed a crash when parsing libraries on macOS. Signed-off-by: Dimitar Dobrev --- src/CppParser/Parser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp index a7cbfe63..8e91fbfc 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -4356,7 +4356,7 @@ ParserResult* Parser::ParseLibrary(const std::string& File) return res; } - llvm::StringRef FileEntry; + llvm::StringRef FileEntry(""); for (unsigned I = 0, E = opts->LibraryDirs.size(); I != E; ++I) { @@ -4368,7 +4368,7 @@ ParserResult* Parser::ParseLibrary(const std::string& File) break; } - if (FileEntry.empty() || !llvm::sys::fs::exists(FileEntry)) + if (FileEntry.empty()) { res->kind = ParserResultKind::FileNotFound; return res;