mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #94 from LianaHus/sol_improve_PR_83
improved overflow checkings
This commit is contained in:
commit
59a2d62c58
@ -859,9 +859,9 @@ u256 ArrayType::memorySize() const
|
||||
{
|
||||
solAssert(!isDynamicallySized(), "");
|
||||
solAssert(m_location == DataLocation::Memory, "");
|
||||
u256 size = m_length * m_baseType->memoryHeadSize();
|
||||
solAssert(size <= numeric_limits<unsigned>::max(), "Array size does not fit unsigned.");
|
||||
return size;
|
||||
bigint size = bigint(m_length) * m_baseType->memoryHeadSize();
|
||||
solAssert(size <= numeric_limits<unsigned>::max(), "Array size does not fit u256.");
|
||||
return u256(size);
|
||||
}
|
||||
|
||||
TypePointer ArrayType::copyForLocation(DataLocation _location, bool _isPointer) const
|
||||
|
Loading…
Reference in New Issue
Block a user