mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Round up allocations to multiples of 32.
This commit is contained in:
committed by
Alex Beregszaszi
parent
31ee06d945
commit
db4b39e09e
@@ -54,7 +54,7 @@ object "Arraysum_34" {
|
||||
function allocateMemory(size) -> memPtr
|
||||
{
|
||||
memPtr := mload(64)
|
||||
let newFreePtr := add(memPtr, size)
|
||||
let newFreePtr := add(memPtr, and(add(size, 31), not(31)))
|
||||
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr))
|
||||
{
|
||||
mstore(0, shl(224, 0x4e487b71))
|
||||
|
||||
Reference in New Issue
Block a user