diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-02-28 15:43:18 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-03-02 00:19:35 +0800 |
commit | 5a54cd5c708227ad6982b06de7b799ece5065917 (patch) | |
tree | c8ee3f47e62584db34931e81878daf8fe0ce3824 /libsolidity/inlineasm | |
parent | 7f8e5733391bf2a02a7d1a701591dedddf6341b0 (diff) | |
download | dexon-solidity-5a54cd5c708227ad6982b06de7b799ece5065917.tar dexon-solidity-5a54cd5c708227ad6982b06de7b799ece5065917.tar.gz dexon-solidity-5a54cd5c708227ad6982b06de7b799ece5065917.tar.bz2 dexon-solidity-5a54cd5c708227ad6982b06de7b799ece5065917.tar.lz dexon-solidity-5a54cd5c708227ad6982b06de7b799ece5065917.tar.xz dexon-solidity-5a54cd5c708227ad6982b06de7b799ece5065917.tar.zst dexon-solidity-5a54cd5c708227ad6982b06de7b799ece5065917.zip |
Only warn for shift instructions if not using constantinople
Diffstat (limited to 'libsolidity/inlineasm')
-rw-r--r-- | libsolidity/inlineasm/AsmAnalysis.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index efa0410d..a7f764a5 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -561,19 +561,19 @@ void AsmAnalyzer::warnOnInstructions(solidity::Instruction _instr, SourceLocatio m_evmVersion.name() + "\", where it will be interpreted as an invalid instruction." ); - - static set<solidity::Instruction> experimentalInstructions{ - solidity::Instruction::SHL, - solidity::Instruction::SHR, - solidity::Instruction::SAR - }; - if (experimentalInstructions.count(_instr)) + else if (( + _instr == solidity::Instruction::SHL || + _instr == solidity::Instruction::SHR || + _instr == solidity::Instruction::SAR + ) && !m_evmVersion.hasBitwiseShifting()) m_errorReporter.warning( _location, "The \"" + boost::to_lower_copy(instructionInfo(_instr).name) - + "\" instruction is only available after " + - "the Constantinople hard fork. Before that it acts as an invalid instruction." + + "\" instruction is only available for Constantinople-compatible VMs. " + + "You are currently compiling for \"" + + m_evmVersion.name() + + "\", where it will be interpreted as an invalid instruction." ); if (_instr == solidity::Instruction::JUMP || _instr == solidity::Instruction::JUMPI || _instr == solidity::Instruction::JUMPDEST) |