diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp index 6de46bfd..6fed223f 100644 --- a/src/CppParser/Parser.cpp +++ b/src/CppParser/Parser.cpp @@ -4389,9 +4389,11 @@ ParserResult* Parser::ParseLibrary(const std::string& File) auto BinaryOrErr = llvm::object::createBinary(FileEntry); if (!BinaryOrErr) { + auto Error = BinaryOrErr.takeError(); res->kind = ParserResultKind::Error; return res; } + auto OwningBinary = std::move(BinaryOrErr.get()); auto Bin = OwningBinary.getBinary(); if (auto Archive = llvm::dyn_cast(Bin)) { @@ -4399,12 +4401,14 @@ ParserResult* Parser::ParseLibrary(const std::string& File) if (res->kind == ParserResultKind::Success) return res; } + if (auto ObjectFile = llvm::dyn_cast(Bin)) { res->kind = ParseSharedLib(File, ObjectFile, res->library); if (res->kind == ParserResultKind::Success) return res; } + res->kind = ParserResultKind::Error; return res; }