solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Avoid copying unused returndata on .call family of functions

Open frangio opened this issue 3 years ago • 0 comments

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();

frangio avatar Aug 05 '22 20:08 frangio