From 8f1ac1c6313e5c1bf754c7131adc7b46d663730a Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 8 Jul 2005 16:48:52 +0000 Subject: 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 --- tools/gccld/GenerateCode.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tools/gccld/GenerateCode.cpp') diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp index f6a08ce8cb..56aaf7d5cf 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; -- cgit v1.2.3-18-g5258