diff options
author | chriseth <chris@ethereum.org> | 2017-10-18 20:53:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-18 20:53:45 +0800 |
commit | 9cf6e910bd2b90d0c9415d9c257f85fe0c518de8 (patch) | |
tree | 6423baec5e26bbe174005c1a89d978cae15015d8 /libevmasm/Instruction.h | |
parent | bdeb9e52a2211510644fb53df93fb98258b40a65 (diff) | |
parent | c85c41880ad1c996517b0ae14f98678b1e6c5613 (diff) | |
download | dexon-solidity-9cf6e910bd2b90d0c9415d9c257f85fe0c518de8.tar dexon-solidity-9cf6e910bd2b90d0c9415d9c257f85fe0c518de8.tar.gz dexon-solidity-9cf6e910bd2b90d0c9415d9c257f85fe0c518de8.tar.bz2 dexon-solidity-9cf6e910bd2b90d0c9415d9c257f85fe0c518de8.tar.lz dexon-solidity-9cf6e910bd2b90d0c9415d9c257f85fe0c518de8.tar.xz dexon-solidity-9cf6e910bd2b90d0c9415d9c257f85fe0c518de8.tar.zst dexon-solidity-9cf6e910bd2b90d0c9415d9c257f85fe0c518de8.zip |
Merge pull request #3099 from ethereum/develop
Merge develop into release for 0.4.18.
Diffstat (limited to 'libevmasm/Instruction.h')
-rw-r--r-- | libevmasm/Instruction.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libevmasm/Instruction.h b/libevmasm/Instruction.h index afbef71d..d9c53900 100644 --- a/libevmasm/Instruction.h +++ b/libevmasm/Instruction.h @@ -197,6 +197,24 @@ enum class Instruction: uint8_t SELFDESTRUCT = 0xff ///< halt execution and register account for later deletion }; +/// @returns true if the instruction is a PUSH +inline bool isPushInstruction(Instruction _inst) +{ + return Instruction::PUSH1 <= _inst && _inst <= Instruction::PUSH32; +} + +/// @returns true if the instruction is a DUP +inline bool isDupInstruction(Instruction _inst) +{ + return Instruction::DUP1 <= _inst && _inst <= Instruction::DUP16; +} + +/// @returns true if the instruction is a SWAP +inline bool isSwapInstruction(Instruction _inst) +{ + return Instruction::SWAP1 <= _inst && _inst <= Instruction::SWAP16; +} + /// @returns the number of PUSH Instruction _inst inline unsigned getPushNumber(Instruction _inst) { |