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
This commit is contained in:
Reid Spencer 2005-07-08 16:48:52 +00:00
parent 6371ccbd8d
commit 8f1ac1c631

View File

@ -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<sys::Path> Files;
LPath.getDirectoryContents(Files);