mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2922 from ethereum/asm-bytes-required
Properly calculate bytesRequired for subs
This commit is contained in:
commit
068a593d9c
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user