mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 12:16:44 +00:00
Throw exception if EVM program is not jitable instead of terminating to make tests going
This commit is contained in:
parent
150162e33d
commit
c97ca249a0
2 changed files with 3 additions and 15 deletions
|
|
@ -901,10 +901,7 @@ void Compiler::linkBasicBlocks()
|
||||||
// TODO: In case entry block is reached - report error
|
// TODO: In case entry block is reached - report error
|
||||||
auto predBB = findBasicBlock(*predIt);
|
auto predBB = findBasicBlock(*predIt);
|
||||||
if (!predBB)
|
if (!predBB)
|
||||||
{
|
BOOST_THROW_EXCEPTION(Exception() << errinfo_comment("Unsupported dynamic stack"));
|
||||||
std::cerr << "Stack too small in " << _llbb->getName().str() << std::endl;
|
|
||||||
std::exit(1);
|
|
||||||
}
|
|
||||||
auto value = predBB->getStack().get(valueIdx);
|
auto value = predBB->getStack().get(valueIdx);
|
||||||
phi->addIncoming(value, predBB->llvm());
|
phi->addIncoming(value, predBB->llvm());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,13 +70,7 @@ int ExecutionEngine::run(std::unique_ptr<llvm::Module> _module, u256& _gas, ExtV
|
||||||
|
|
||||||
auto exec = std::unique_ptr<llvm::ExecutionEngine>(builder.create());
|
auto exec = std::unique_ptr<llvm::ExecutionEngine>(builder.create());
|
||||||
if (!exec)
|
if (!exec)
|
||||||
{
|
BOOST_THROW_EXCEPTION(Exception() << errinfo_comment(errorMsg));
|
||||||
if (!errorMsg.empty())
|
|
||||||
std::cerr << "error creating EE: " << errorMsg << std::endl;
|
|
||||||
else
|
|
||||||
std::cerr << "unknown error creating llvm::ExecutionEngine" << std::endl;
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
_module.release(); // Successfully created llvm::ExecutionEngine takes ownership of the module
|
_module.release(); // Successfully created llvm::ExecutionEngine takes ownership of the module
|
||||||
exec->finalizeObject();
|
exec->finalizeObject();
|
||||||
|
|
||||||
|
|
@ -106,10 +100,7 @@ int ExecutionEngine::run(std::unique_ptr<llvm::Module> _module, u256& _gas, ExtV
|
||||||
|
|
||||||
auto entryFunc = module->getFunction("main");
|
auto entryFunc = module->getFunction("main");
|
||||||
if (!entryFunc)
|
if (!entryFunc)
|
||||||
{
|
BOOST_THROW_EXCEPTION(Exception() << errinfo_comment("main function not found"));
|
||||||
std::cerr << "main function not found\n";
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnCode returnCode;
|
ReturnCode returnCode;
|
||||||
std::jmp_buf buf;
|
std::jmp_buf buf;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue