Fixed bug reported by Ken Ryall.

llvm-svn: 124231
This commit is contained in:
Greg Clayton 2011-01-25 21:32:01 +00:00
parent 624cef696d
commit 58f417180b
1 changed files with 24 additions and 20 deletions

View File

@ -497,7 +497,10 @@ FileSpec::ResolveExecutableLocation ()
{
if (!m_directory)
{
const std::string file_str (m_filename.AsCString());
const char *file_cstr = m_filename.GetCString();
if (file_cstr)
{
const std::string file_str (file_cstr);
llvm::sys::Path path = llvm::sys::Program::FindProgramByName (file_str);
const std::string &path_str = path.str();
llvm::StringRef dir_ref = llvm::sys::path::parent_path(path_str);
@ -524,6 +527,7 @@ FileSpec::ResolveExecutableLocation ()
}
}
}
}
return false;
}