diff options
author | chriseth <chris@ethereum.org> | 2018-09-26 20:53:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-26 20:53:44 +0800 |
commit | 46f630c5a67965acb31dead1ac19373e58097ea2 (patch) | |
tree | e51ad9bbd33b6b5c961396aa79dbee097540768f /libsolidity | |
parent | 83d89e43b167492f0b32f58a6782e8a16e5f5407 (diff) | |
parent | 8cfc6c98d631308c4ad9b677c3b6ab254fadc6bd (diff) | |
download | dexon-solidity-46f630c5a67965acb31dead1ac19373e58097ea2.tar.gz dexon-solidity-46f630c5a67965acb31dead1ac19373e58097ea2.tar.zst dexon-solidity-46f630c5a67965acb31dead1ac19373e58097ea2.zip |
Merge pull request #5092 from ethereum/create2-evmversion
CREATE2 is part of Constantinople now
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/inlineasm/AsmAnalysis.cpp | 17 | ||||
-rw-r--r-- | libsolidity/interface/EVMVersion.h | 1 |
2 files changed, 6 insertions, 12 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index 9a0110cf..0f2c0f56 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -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, diff --git a/libsolidity/interface/EVMVersion.h b/libsolidity/interface/EVMVersion.h index b68e1f4e..657727ac 100644 --- a/libsolidity/interface/EVMVersion.h +++ b/libsolidity/interface/EVMVersion.h @@ -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). |