Skip to content

Commit

Permalink
Tag memory safe assembly blocks (#5193)
Browse files Browse the repository at this point in the history
  • Loading branch information
cairoeth committed Sep 9, 2024
1 parent c01a0fa commit cae60c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/governance/Governor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72

// Extract what would be the `#proposer=0x` marker beginning the suffix
bytes12 marker;
assembly {
assembly ("memory-safe") {
// - Start of the string contents in memory = description + 32
// - First character of the marker = len - 52
// - Length of "#proposer=0x0000000000000000000000000000000000000000" = 52
Expand Down
2 changes: 1 addition & 1 deletion contracts/metatx/ERC2771Forwarder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ contract ERC2771Forwarder is EIP712, Nonces {

uint256 gasLeft;

assembly {
assembly ("memory-safe") {
success := call(reqGas, to, value, add(data, 0x20), mload(data), 0, 0)
gasLeft := gas()
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/introspection/ERC165Checker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ library ERC165Checker {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly {
assembly ("memory-safe") {
success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
returnSize := returndatasize()
returnValue := mload(0x00)
Expand Down

0 comments on commit cae60c5

Please sign in to comment.