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