diff options
author | Dimitry <winsvega@mail.ru> | 2017-06-08 22:44:03 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-06-15 00:18:12 +0800 |
commit | c20cdd0a0574c350b5cde7b38e87321479cecab3 (patch) | |
tree | 5e7bc76cba1ec47124eb3bba453a2c994c0d766a /libsolidity | |
parent | d693822a6fce5d1c853e50f4c7758bc003542644 (diff) | |
download | dexon-solidity-c20cdd0a0574c350b5cde7b38e87321479cecab3.tar dexon-solidity-c20cdd0a0574c350b5cde7b38e87321479cecab3.tar.gz dexon-solidity-c20cdd0a0574c350b5cde7b38e87321479cecab3.tar.bz2 dexon-solidity-c20cdd0a0574c350b5cde7b38e87321479cecab3.tar.lz dexon-solidity-c20cdd0a0574c350b5cde7b38e87321479cecab3.tar.xz dexon-solidity-c20cdd0a0574c350b5cde7b38e87321479cecab3.tar.zst dexon-solidity-c20cdd0a0574c350b5cde7b38e87321479cecab3.zip |
add new opcode instructions to the parser
STATICCALL 0xfa 6 inputs (gas address mem1 mem2 mem3 mem4)
Diffstat (limited to 'libsolidity')
-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." ); } |