Skip to content

Commit

Permalink
mask straight after calldata load
Browse files Browse the repository at this point in the history
  • Loading branch information
hensha256 committed Sep 4, 2024
1 parent a815baf commit c755eed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libraries/CalldataDecoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ library CalldataDecoder {
let bytesOffset := and(_bytes.offset, OFFSET_OR_LENGTH_MASK)
// The offset of the `_arg`-th element is `32 * arg`, which stores the offset of the length pointer.
// shl(5, x) is equivalent to mul(32, x)
let lengthPtr := and(add(bytesOffset, calldataload(add(bytesOffset, shl(5, _arg)))), OFFSET_OR_LENGTH_MASK)
let lengthPtr := add(bytesOffset, and(calldataload(add(bytesOffset, shl(5, _arg))), OFFSET_OR_LENGTH_MASK))
// the number of byte strings in the byte array
let arrayLength := and(calldataload(lengthPtr), OFFSET_OR_LENGTH_MASK)

Expand Down

0 comments on commit c755eed

Please sign in to comment.