mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix array allocation.
This commit is contained in:
parent
a26e6eacdc
commit
f4479fd7ed
@ -4218,13 +4218,7 @@ string YulUtilFunctions::extractReturndataFunction()
|
|||||||
data := <emptyArray>()
|
data := <emptyArray>()
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
// allocate some memory into data of size returndatasize() + PADDING
|
data := <allocateArray>(returndatasize())
|
||||||
data := <allocate>(<roundUp>(add(returndatasize(), 0x20)))
|
|
||||||
|
|
||||||
// store array length into the front
|
|
||||||
mstore(data, returndatasize())
|
|
||||||
|
|
||||||
// append to data
|
|
||||||
returndatacopy(add(data, 0x20), 0, returndatasize())
|
returndatacopy(add(data, 0x20), 0, returndatasize())
|
||||||
}
|
}
|
||||||
<!supportsReturndata>
|
<!supportsReturndata>
|
||||||
@ -4234,8 +4228,7 @@ string YulUtilFunctions::extractReturndataFunction()
|
|||||||
)")
|
)")
|
||||||
("functionName", functionName)
|
("functionName", functionName)
|
||||||
("supportsReturndata", m_evmVersion.supportsReturndata())
|
("supportsReturndata", m_evmVersion.supportsReturndata())
|
||||||
("allocate", allocationFunction())
|
("allocateArray", allocateMemoryArrayFunction(*TypeProvider::bytesMemory()))
|
||||||
("roundUp", roundUpFunction())
|
|
||||||
("emptyArray", zeroValueFunction(*TypeProvider::bytesMemory()))
|
("emptyArray", zeroValueFunction(*TypeProvider::bytesMemory()))
|
||||||
.render();
|
.render();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user