mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #5092 from ethereum/create2-evmversion
CREATE2 is part of Constantinople now
This commit is contained in:
@@ -565,18 +565,10 @@ void AsmAnalyzer::warnOnInstructions(solidity::Instruction _instr, SourceLocatio
|
||||
// We assume that returndatacopy, returndatasize and staticcall are either all available
|
||||
// or all not available.
|
||||
solAssert(m_evmVersion.supportsReturndata() == m_evmVersion.hasStaticCall(), "");
|
||||
// Similarly we assume bitwise shifting and create2 go together.
|
||||
solAssert(m_evmVersion.hasBitwiseShifting() == m_evmVersion.hasCreate2(), "");
|
||||
|
||||
if (_instr == solidity::Instruction::CREATE2)
|
||||
m_errorReporter.warning(
|
||||
_location,
|
||||
"The \"" +
|
||||
boost::to_lower_copy(instructionInfo(_instr).name)
|
||||
+ "\" instruction is not supported by the VM version \"" +
|
||||
"" + m_evmVersion.name() +
|
||||
"\" you are currently compiling for. " +
|
||||
"It will be interpreted as an invalid instruction on this VM."
|
||||
);
|
||||
else if ((
|
||||
if ((
|
||||
_instr == solidity::Instruction::RETURNDATACOPY ||
|
||||
_instr == solidity::Instruction::RETURNDATASIZE ||
|
||||
_instr == solidity::Instruction::STATICCALL
|
||||
@@ -593,7 +585,8 @@ void AsmAnalyzer::warnOnInstructions(solidity::Instruction _instr, SourceLocatio
|
||||
else if ((
|
||||
_instr == solidity::Instruction::SHL ||
|
||||
_instr == solidity::Instruction::SHR ||
|
||||
_instr == solidity::Instruction::SAR
|
||||
_instr == solidity::Instruction::SAR ||
|
||||
_instr == solidity::Instruction::CREATE2
|
||||
) && !m_evmVersion.hasBitwiseShifting())
|
||||
m_errorReporter.warning(
|
||||
_location,
|
||||
|
||||
@@ -75,6 +75,7 @@ public:
|
||||
bool supportsReturndata() const { return *this >= byzantium(); }
|
||||
bool hasStaticCall() const { return *this >= byzantium(); }
|
||||
bool hasBitwiseShifting() const { return *this >= constantinople(); }
|
||||
bool hasCreate2() const { return *this >= constantinople(); }
|
||||
|
||||
/// Whether we have to retain the costs for the call opcode itself (false),
|
||||
/// or whether we can just forward easily all remaining gas (true).
|
||||
|
||||
Reference in New Issue
Block a user