Update declaration of memory safe assembly blocks (#5172)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
@ -336,8 +336,7 @@ library Math {
|
||||
*/
|
||||
function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {
|
||||
if (m == 0) return (false, 0);
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
assembly ("memory-safe") {
|
||||
let ptr := mload(0x40)
|
||||
// | Offset | Content | Content (Hex) |
|
||||
// |-----------|------------|--------------------------------------------------------------------|
|
||||
@ -387,8 +386,7 @@ library Math {
|
||||
// Encode call args in result and move the free memory pointer
|
||||
result = abi.encodePacked(b.length, e.length, mLen, b, e, m);
|
||||
|
||||
/// @solidity memory-safe-assembly
|
||||
assembly {
|
||||
assembly ("memory-safe") {
|
||||
let dataPtr := add(result, 0x20)
|
||||
// Write result on top of args to avoid allocating extra memory.
|
||||
success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)
|
||||
|
||||
Reference in New Issue
Block a user