From c38a1c7061a057798e9cb17e1f0846c6700945b4 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 8 Jul 2005 16:48:52 +0000 Subject: [PATCH] Make sure we don't error out if an invalid path is used, just simply exit from isBytecodeLPath with "false". llvm-svn: 22360 --- tools/gccld/GenerateCode.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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,10 +154,21 @@ static bool isBytecodeLPath(const std::string &LibPath) { sys::Path LPath(LibPath); - // Make sure its a directory - if (!LPath.isDirectory()) + // Make sure it exists + if (!LPath.exists()) return isBytecodeLPath; + // Make sure its a directory + try + { + if (!LPath.isDirectory()) + return isBytecodeLPath; + } + catch (std::string& xcptn) + { + return isBytecodeLPath; + } + // Grab the contents of the -L path std::set Files; LPath.getDirectoryContents(Files);