Skip to content

Commit

Permalink
Use free memory pointer for returndatacopy (#5057)
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio authored May 27, 2024
1 parent faa6255 commit a241f09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions contracts/utils/Create2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ library Create2 {
addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)
// if no address was created, and returndata is not empty, bubble revert
if and(iszero(addr), not(iszero(returndatasize()))) {
returndatacopy(0, 0, returndatasize())
revert(0, returndatasize())
let p := mload(0x40)
returndatacopy(p, 0, returndatasize())
revert(p, returndatasize())
}
}
if (addr == address(0)) {
Expand Down

0 comments on commit a241f09

Please sign in to comment.