diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-02 17:22:58 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-02 17:34:54 +0800 |
commit | 8a32d7c3d73a303198ab069459718cd2de1be67c (patch) | |
tree | a4eeccab1f5ff547528dff4cf675006336c435b2 /libsolidity | |
parent | ba7c5d2305d3486ddd699637a881ee229627082f (diff) | |
download | dexon-solidity-8a32d7c3d73a303198ab069459718cd2de1be67c.tar.gz dexon-solidity-8a32d7c3d73a303198ab069459718cd2de1be67c.tar.zst dexon-solidity-8a32d7c3d73a303198ab069459718cd2de1be67c.zip |
Add helpers for isPush/isDup/isSwap
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/inlineasm/AsmParser.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libsolidity/inlineasm/AsmParser.cpp b/libsolidity/inlineasm/AsmParser.cpp index 3087ad86..1f4df75b 100644 --- a/libsolidity/inlineasm/AsmParser.cpp +++ b/libsolidity/inlineasm/AsmParser.cpp @@ -256,7 +256,7 @@ std::map<string, dev::solidity::Instruction> const& Parser::instructions() { if ( instruction.second == solidity::Instruction::JUMPDEST || - (solidity::Instruction::PUSH1 <= instruction.second && instruction.second <= solidity::Instruction::PUSH32) + solidity::isPushInstruction(instruction.second) ) continue; string name = instruction.first; @@ -443,9 +443,9 @@ assembly::Statement Parser::parseCall(assembly::Statement&& _instruction) ret.location = ret.instruction.location; solidity::Instruction instr = ret.instruction.instruction; InstructionInfo instrInfo = instructionInfo(instr); - if (solidity::Instruction::DUP1 <= instr && instr <= solidity::Instruction::DUP16) + if (solidity::isDupInstruction(instr)) fatalParserError("DUPi instructions not allowed for functional notation"); - if (solidity::Instruction::SWAP1 <= instr && instr <= solidity::Instruction::SWAP16) + if (solidity::isSwapInstruction(instr)) fatalParserError("SWAPi instructions not allowed for functional notation"); expectToken(Token::LParen); unsigned args = unsigned(instrInfo.args); |