diff options
author | chriseth <chris@ethereum.org> | 2017-09-18 22:38:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-18 22:38:02 +0800 |
commit | 068a593d9c7ab31d1048199d262da3702f188bd3 (patch) | |
tree | 04ead218ea3fc9b900e14fa3947b40fca1cfe761 /libevmasm | |
parent | f676325d60dbc6c1120ce5a4478f363622c1b1cf (diff) | |
parent | 20ffa1db43c84168ba887bb3460959dcb2584278 (diff) | |
download | dexon-solidity-068a593d9c7ab31d1048199d262da3702f188bd3.tar.gz dexon-solidity-068a593d9c7ab31d1048199d262da3702f188bd3.tar.zst dexon-solidity-068a593d9c7ab31d1048199d262da3702f188bd3.zip |
Merge pull request #2922 from ethereum/asm-bytes-required
Properly calculate bytesRequired for subs
Diffstat (limited to 'libevmasm')
-rw-r--r-- | libevmasm/AssemblyItem.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libevmasm/AssemblyItem.cpp b/libevmasm/AssemblyItem.cpp index 1af266b6..cfe91be0 100644 --- a/libevmasm/AssemblyItem.cpp +++ b/libevmasm/AssemblyItem.cpp @@ -59,18 +59,18 @@ unsigned AssemblyItem::bytesRequired(unsigned _addressLength) const case Tag: // 1 byte for the JUMPDEST return 1; case PushString: - return 33; + return 1 + 32; case Push: return 1 + max<unsigned>(1, dev::bytesRequired(data())); case PushSubSize: case PushProgramSize: - return 4; // worst case: a 16MB program + return 1 + 4; // worst case: a 16MB program case PushTag: case PushData: case PushSub: return 1 + _addressLength; case PushLibraryAddress: - return 21; + return 1 + 20; default: break; } |