diff options
author | Chris Lattner <sabre@nondot.org> | 2005-12-01 22:48:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-12-01 22:48:23 +0000 |
commit | 48ba8221af97cc76cb2018ceac490d7b5d0fa6ff (patch) | |
tree | f16d0b654b54f5ea3accc47c2f815251c5f15e20 /tools/lli | |
parent | 9ad17c9c9abfd6e011751d2fd2b03448e1dccb71 (diff) | |
download | llvm-48ba8221af97cc76cb2018ceac490d7b5d0fa6ff.tar.gz llvm-48ba8221af97cc76cb2018ceac490d7b5d0fa6ff.tar.bz2 llvm-48ba8221af97cc76cb2018ceac490d7b5d0fa6ff.tar.xz |
If a module has a main, but it is defined externally, refuse to run it.
Attempting to run it will find lli's main, which isn't the desired effect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24569 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lli')
-rw-r--r-- | tools/lli/lli.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index c1b7478a37..93eb6fce5d 100644 --- a/tools/lli/lli.cpp +++ b/tools/lli/lli.cpp @@ -85,7 +85,7 @@ int main(int argc, char **argv, char * const *envp) { // EnvVars to determine envp. // Function *Fn = MP->getModule()->getMainFunction(); - if (!Fn) { + if (!Fn || Fn->isExternal()) { std::cerr << "'main' function not found in module.\n"; return -1; } |