Skip to content

Commit a241f09

Browse files
authored
Use free memory pointer for returndatacopy (#5057)
1 parent faa6255 commit a241f09

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

contracts/utils/Create2.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ library Create2 {
4646
addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)
4747
// if no address was created, and returndata is not empty, bubble revert
4848
if and(iszero(addr), not(iszero(returndatasize()))) {
49-
returndatacopy(0, 0, returndatasize())
50-
revert(0, returndatasize())
49+
let p := mload(0x40)
50+
returndatacopy(p, 0, returndatasize())
51+
revert(p, returndatasize())
5152
}
5253
}
5354
if (addr == address(0)) {

0 commit comments

Comments
 (0)