summaryrefslogtreecommitdiff
path: root/tools/gccld
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-07-08 16:48:52 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-07-08 16:48:52 +0000
commit8f1ac1c6313e5c1bf754c7131adc7b46d663730a (patch)
tree0d34744c6331a506f882c900b38594366d7d17ab /tools/gccld
parent6371ccbd8d3838bdc7ca4f2cc9c807e84ecc93a8 (diff)
downloadllvm-8f1ac1c6313e5c1bf754c7131adc7b46d663730a.tar.gz
llvm-8f1ac1c6313e5c1bf754c7131adc7b46d663730a.tar.bz2
llvm-8f1ac1c6313e5c1bf754c7131adc7b46d663730a.tar.xz
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
Diffstat (limited to 'tools/gccld')
-rw-r--r--tools/gccld/GenerateCode.cpp13
1 files changed, 12 insertions, 1 deletions
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<sys::Path> Files;