forked from OSchip/llvm-project
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. llvm-svn: 24569
This commit is contained in:
parent
05b0b4575b
commit
ef2d8ca0b6
|
@ -85,7 +85,7 @@ int main(int argc, char **argv, char * const *envp) {
|
||||||
// EnvVars to determine envp.
|
// EnvVars to determine envp.
|
||||||
//
|
//
|
||||||
Function *Fn = MP->getModule()->getMainFunction();
|
Function *Fn = MP->getModule()->getMainFunction();
|
||||||
if (!Fn) {
|
if (!Fn || Fn->isExternal()) {
|
||||||
std::cerr << "'main' function not found in module.\n";
|
std::cerr << "'main' function not found in module.\n";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue