diff options
author | Alp Toker <alp@nuanti.com> | 2014-01-22 22:17:51 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-01-22 22:17:51 +0000 |
commit | ac2d2e0a3db575c216e0a6f8f5dae59adcf08e07 (patch) | |
tree | 247b825ad110744d3c3abe95c9cf4866c1b82187 /tools/lli/lli.cpp | |
parent | a73e920f0982137083ba6291842cd81f4100fb0e (diff) | |
download | llvm-ac2d2e0a3db575c216e0a6f8f5dae59adcf08e07.tar.gz llvm-ac2d2e0a3db575c216e0a6f8f5dae59adcf08e07.tar.bz2 llvm-ac2d2e0a3db575c216e0a6f8f5dae59adcf08e07.tar.xz |
Tweak r199835 to use can_execute() instead of exists()
The execution code path crashes if it can't execute the binary so we might as
well take precautions here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199844 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lli/lli.cpp')
-rw-r--r-- | tools/lli/lli.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index e6d4087476..e36d917958 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -668,8 +668,9 @@ int main(int argc, char **argv, char * const *envp) { << " Defaulting to simulated remote execution\n"; Target.reset(RemoteTarget::createRemoteTarget()); } else { - if (!sys::fs::exists(ChildExecPath)) { - errs() << "Unable to find child target: '" << ChildExecPath << "'\n"; + if (!sys::fs::can_execute(ChildExecPath)) { + errs() << "Unable to find usable child executable: '" << ChildExecPath + << "'\n"; return -1; } Target.reset(RemoteTarget::createExternalRemoteTarget(ChildExecPath)); |