mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Ensure that EVMC capability is checked after loading evmone
This commit is contained in:
parent
efeee15d32
commit
f77d7c2dc7
@ -44,8 +44,16 @@ evmc::vm* EVMHost::getVM(string const& _path)
|
||||
evmc_loader_error_code errorCode = {};
|
||||
evmc_instance* vm = evmc_load_and_create(_path.c_str(), &errorCode);
|
||||
if (vm && errorCode == EVMC_LOADER_SUCCESS)
|
||||
{
|
||||
if (evmc_vm_has_capability(vm, EVMC_CAPABILITY_EVM1))
|
||||
theVM = make_unique<evmc::vm>(vm);
|
||||
else
|
||||
{
|
||||
evmc_destroy(vm);
|
||||
cerr << "VM loaded does not support EVM1" << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cerr << "Error loading VM from " << _path;
|
||||
if (char const* errorMsg = evmc_last_error_msg())
|
||||
|
Loading…
Reference in New Issue
Block a user