You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use zero values for calldata (CalldataCopy) and returndata (ReturndataCopy) out-of-range slice portions #10933
Follow up of #7385 where errors for the out-of-range memory target were introduced. In this case, we do not throw an error but return zero values, e.g.,
calldata = [0,1,2,3,4,5,6,7]
slice of calldata with startPos = 4 and size = 8 will return [4,5,6,7,0,0,0,0].
According to the current code, a TS slice is applied on the array (calldata resp. returndata) which does not throw an error but will "slice" the valid truncated portion of the array or return an empty array.
This will lead to an assertion being hit ( memory.assert({ reads: 2, writes: copySize, addressing });)
changed the title [-]Handle out-of-range errors for calldata (CalldataCopy) and returndata (ReturndataCopy)[/-][+]Use zero values for calldata (CalldataCopy) and returndata (ReturndataCopy) out-of-range slice portions[/+]on Jan 16, 2025
Activity
jeanmon commentedon Jan 15, 2025
According to the current code, a TS slice is applied on the array (calldata resp. returndata) which does not throw an error but will "slice" the valid truncated portion of the array or return an empty array.
This will lead to an assertion being hit ( memory.assert({ reads: 2, writes: copySize, addressing });)
[-]Handle out-of-range errors for calldata (CalldataCopy) and returndata (ReturndataCopy)[/-][+]Use zero values for calldata (CalldataCopy) and returndata (ReturndataCopy) out-of-range slice portions[/+]chore(avm): calldata, returndata slices out of range padded with zeros (
chore(master): Release 0.71.0 (#11247)
chore(master): Release 0.71.0 (#11247)