Rewrite assembly slot offset for consistency (#5325)
This commit is contained in:
@ -48,7 +48,7 @@ library Strings {
|
||||
string memory buffer = new string(length);
|
||||
uint256 ptr;
|
||||
assembly ("memory-safe") {
|
||||
ptr := add(buffer, add(32, length))
|
||||
ptr := add(add(buffer, 0x20), length)
|
||||
}
|
||||
while (true) {
|
||||
ptr--;
|
||||
@ -484,7 +484,7 @@ library Strings {
|
||||
function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {
|
||||
// This is not memory safe in the general case, but all calls to this private function are within bounds.
|
||||
assembly ("memory-safe") {
|
||||
value := mload(add(buffer, add(0x20, offset)))
|
||||
value := mload(add(add(buffer, 0x20), offset))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user