diff options
author | chriseth <chris@ethereum.org> | 2017-06-15 14:39:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-15 14:39:02 +0800 |
commit | 66881bd675ad483ae0bba813c79257fbc30ee941 (patch) | |
tree | 7da1d2982ae3343ae8842bbf32b3aeaea99c8018 /libsolidity/inlineasm/AsmAnalysis.cpp | |
parent | 3c4671a2dafc3fc29f5662203cceeb17a0d0e36b (diff) | |
parent | 42b61171d981ceccd5f79af5508db92b4f2ad54b (diff) | |
download | dexon-solidity-66881bd675ad483ae0bba813c79257fbc30ee941.tar dexon-solidity-66881bd675ad483ae0bba813c79257fbc30ee941.tar.gz dexon-solidity-66881bd675ad483ae0bba813c79257fbc30ee941.tar.bz2 dexon-solidity-66881bd675ad483ae0bba813c79257fbc30ee941.tar.lz dexon-solidity-66881bd675ad483ae0bba813c79257fbc30ee941.tar.xz dexon-solidity-66881bd675ad483ae0bba813c79257fbc30ee941.tar.zst dexon-solidity-66881bd675ad483ae0bba813c79257fbc30ee941.zip |
Merge branch 'develop' into asm-aux
Diffstat (limited to 'libsolidity/inlineasm/AsmAnalysis.cpp')
-rw-r--r-- | libsolidity/inlineasm/AsmAnalysis.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index 630e0abf..1a529118 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -29,6 +29,7 @@ #include <libsolidity/interface/Utils.h> #include <boost/range/adaptor/reversed.hpp> +#include <boost/algorithm/string.hpp> #include <memory> #include <functional> @@ -447,25 +448,18 @@ void AsmAnalyzer::expectValidType(string const& type, SourceLocation const& _loc void AsmAnalyzer::warnOnFutureInstruction(solidity::Instruction _instr, SourceLocation const& _location) { - string instr; - switch (_instr) - { - case solidity::Instruction::CREATE2: - instr = "create2"; - break; - case solidity::Instruction::RETURNDATASIZE: - instr = "returndatasize"; - break; - case solidity::Instruction::RETURNDATACOPY: - instr = "returndatacopy"; - break; - default: - break; - } - if (!instr.empty()) + static set<solidity::Instruction> futureInstructions{ + solidity::Instruction::CREATE2, + solidity::Instruction::RETURNDATACOPY, + solidity::Instruction::RETURNDATASIZE, + solidity::Instruction::STATICCALL + }; + if (futureInstructions.count(_instr)) m_errorReporter.warning( _location, - "The \"" + instr + "\" instruction is only available after " + + "The \"" + + boost::to_lower_copy(instructionInfo(_instr).name) + + "\" instruction is only available after " + "the Metropolis hard fork. Before that it acts as an invalid instruction." ); } |