aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-09-18 18:04:24 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-09-18 18:39:49 +0800
commit20ffa1db43c84168ba887bb3460959dcb2584278 (patch)
tree924e0f980d202482e098bc1fabd331dc2895d3f5 /libevmasm
parenta0d171722a211720773aae0ded8a80991d44ba9d (diff)
downloaddexon-solidity-20ffa1db43c84168ba887bb3460959dcb2584278.tar
dexon-solidity-20ffa1db43c84168ba887bb3460959dcb2584278.tar.gz
dexon-solidity-20ffa1db43c84168ba887bb3460959dcb2584278.tar.bz2
dexon-solidity-20ffa1db43c84168ba887bb3460959dcb2584278.tar.lz
dexon-solidity-20ffa1db43c84168ba887bb3460959dcb2584278.tar.xz
dexon-solidity-20ffa1db43c84168ba887bb3460959dcb2584278.tar.zst
dexon-solidity-20ffa1db43c84168ba887bb3460959dcb2584278.zip
Properly calculate bytesRequired for subs
Diffstat (limited to 'libevmasm')
-rw-r--r--libevmasm/AssemblyItem.cpp6
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;
}