diff options
author | chriseth <chris@ethereum.org> | 2017-01-25 00:35:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-25 00:35:21 +0800 |
commit | 29dab03ec8b595fc25e010bd8b60b2e280d0ebed (patch) | |
tree | 0762448b2881d491817b0d1c25456cc6ae157148 /libevmasm/AssemblyItem.cpp | |
parent | b52a60402d0885f8700658488b02bc48f7746aaf (diff) | |
parent | 997f5d751a21263b1f104d547486abca3ee3bff6 (diff) | |
download | dexon-solidity-29dab03ec8b595fc25e010bd8b60b2e280d0ebed.tar dexon-solidity-29dab03ec8b595fc25e010bd8b60b2e280d0ebed.tar.gz dexon-solidity-29dab03ec8b595fc25e010bd8b60b2e280d0ebed.tar.bz2 dexon-solidity-29dab03ec8b595fc25e010bd8b60b2e280d0ebed.tar.lz dexon-solidity-29dab03ec8b595fc25e010bd8b60b2e280d0ebed.tar.xz dexon-solidity-29dab03ec8b595fc25e010bd8b60b2e280d0ebed.tar.zst dexon-solidity-29dab03ec8b595fc25e010bd8b60b2e280d0ebed.zip |
Merge pull request #1600 from ethereum/functionalAsmOut
Create functional assembly output, if possible.
Diffstat (limited to 'libevmasm/AssemblyItem.cpp')
-rw-r--r-- | libevmasm/AssemblyItem.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libevmasm/AssemblyItem.cpp b/libevmasm/AssemblyItem.cpp index 6c7d5425..26d9fded 100644 --- a/libevmasm/AssemblyItem.cpp +++ b/libevmasm/AssemblyItem.cpp @@ -76,12 +76,20 @@ unsigned AssemblyItem::bytesRequired(unsigned _addressLength) const BOOST_THROW_EXCEPTION(InvalidOpcode()); } -int AssemblyItem::deposit() const +int AssemblyItem::arguments() const +{ + if (type() == Operation) + return instructionInfo(instruction()).args; + else + return 0; +} + +int AssemblyItem::returnValues() const { switch (m_type) { case Operation: - return instructionInfo(instruction()).ret - instructionInfo(instruction()).args; + return instructionInfo(instruction()).ret; case Push: case PushString: case PushTag: |