solidity
solidity copied to clipboard
Avoid copying unused returndata on .call family of functions
For some reason I thought this had been fixed in https://github.com/ethereum/solidity/pull/12684 but it doesn't seem to be the case...
When the return data of a call is not stored in a variable (or more generally, when it's not used), it shouldn't be copied to memory. See https://github.com/ethereum/solidity/issues/12647 for a discussion on why this is important.
The snippet below emits returndatacopy for the entirety of the returndata size.
(book ok, ) = target.call();