From: Reid Spencer Date: Fri, 8 Jul 2005 16:48:52 +0000 (+0000) Subject: Make sure we don't error out if an invalid path is used, just simply X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8f1ac1c6313e5c1bf754c7131adc7b46d663730a;p=oota-llvm.git Make sure we don't error out if an invalid path is used, just simply exit from isBytecodeLPath with "false". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22360 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp index f6a08ce8cb0..56aaf7d5cfc 100644 --- a/tools/gccld/GenerateCode.cpp +++ b/tools/gccld/GenerateCode.cpp @@ -154,9 +154,20 @@ static bool isBytecodeLPath(const std::string &LibPath) { sys::Path LPath(LibPath); + // Make sure it exists + if (!LPath.exists()) + return isBytecodeLPath; + // Make sure its a directory - if (!LPath.isDirectory()) + try + { + if (!LPath.isDirectory()) + return isBytecodeLPath; + } + catch (std::string& xcptn) + { return isBytecodeLPath; + } // Grab the contents of the -L path std::set Files;