Make sure we don't error out if an invalid path is used, just simply
authorReid Spencer <rspencer@reidspencer.com>
Fri, 8 Jul 2005 16:48:52 +0000 (16:48 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Fri, 8 Jul 2005 16:48:52 +0000 (16:48 +0000)
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

index f6a08ce8cb054d37a8abfdd71d3497c9d8d05623..56aaf7d5cfc04f66145ea44ee5f0d4dd2ae4b227 100644 (file)
@@ -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<sys::Path> Files;