mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #7868 from ethereum/evmc-host-byzantium
EVMHost: disallow Byzantium precompiles on earlier EVM versions
This commit is contained in:
commit
04222f0e2b
@ -123,13 +123,13 @@ evmc::result EVMHost::call(evmc_message const& _message) noexcept
|
||||
return precompileRipeMD160(_message);
|
||||
else if (_message.destination == 0x0000000000000000000000000000000000000004_address)
|
||||
return precompileIdentity(_message);
|
||||
else if (_message.destination == 0x0000000000000000000000000000000000000005_address)
|
||||
else if (_message.destination == 0x0000000000000000000000000000000000000005_address && m_evmVersion >= langutil::EVMVersion::byzantium())
|
||||
return precompileModExp(_message);
|
||||
else if (_message.destination == 0x0000000000000000000000000000000000000006_address)
|
||||
else if (_message.destination == 0x0000000000000000000000000000000000000006_address && m_evmVersion >= langutil::EVMVersion::byzantium())
|
||||
return precompileALTBN128G1Add(_message);
|
||||
else if (_message.destination == 0x0000000000000000000000000000000000000007_address)
|
||||
else if (_message.destination == 0x0000000000000000000000000000000000000007_address && m_evmVersion >= langutil::EVMVersion::byzantium())
|
||||
return precompileALTBN128G1Mul(_message);
|
||||
else if (_message.destination == 0x0000000000000000000000000000000000000008_address)
|
||||
else if (_message.destination == 0x0000000000000000000000000000000000000008_address && m_evmVersion >= langutil::EVMVersion::byzantium())
|
||||
return precompileALTBN128PairingProduct(_message);
|
||||
|
||||
State stateBackup = m_state;
|
||||
|
@ -43,6 +43,7 @@
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
using namespace dev::test;
|
||||
using namespace langutil;
|
||||
|
||||
#define ALSO_VIA_YUL(CODE) \
|
||||
{ \
|
||||
@ -12888,6 +12889,9 @@ BOOST_AUTO_TEST_CASE(address_overload_resolution)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(snark)
|
||||
{
|
||||
if (dev::test::Options::get().evmVersion() <= EVMVersion::byzantium())
|
||||
return;
|
||||
|
||||
char const* sourceCode = R"(
|
||||
library Pairing {
|
||||
struct G1Point {
|
||||
|
Loading…
Reference in New Issue
Block a user