summaryrefslogtreecommitdiffstats
path: root/llvm/tools/lli/lli.cpp
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-22 22:17:51 +0000
committerAlp Toker <alp@nuanti.com>2014-01-22 22:17:51 +0000
commit912d49b106669862160eca7b7570780d09a508fe (patch)
treed036cf5c72c8b32ca96bb2496c781f0571bf203b /llvm/tools/lli/lli.cpp
parent20fcda7162fd6a993a09f1f7438ece546e002f1d (diff)
downloadbcm5719-llvm-912d49b106669862160eca7b7570780d09a508fe.tar.gz
bcm5719-llvm-912d49b106669862160eca7b7570780d09a508fe.zip
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. llvm-svn: 199844
Diffstat (limited to 'llvm/tools/lli/lli.cpp')
-rw-r--r--llvm/tools/lli/lli.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp
index e6d4087476f..e36d9179584 100644
--- a/llvm/tools/lli/lli.cpp
+++ b/llvm/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));
OpenPOWER on IntegriCloud