Skip to content

Commit

Permalink
Optimize extension offset bounds checks
Browse files Browse the repository at this point in the history
  • Loading branch information
k06a committed Aug 17, 2023
1 parent 6a3522b commit 989ac53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/libraries/OffsetsLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ library OffsetsLib {
let end := and(0xffffffff, shr(bitShift, offsets)) // end = offsets[ bitShift + 32 : bitShift + 64 ]
result.offset := add(concat.offset, begin)
result.length := sub(end, begin)
if gt(add(result.offset, result.length), add(concat.offset, concat.length)) {
if gt(end, concat.length) {
mstore(0, exception)
revert(0, 4)
}
Expand Down

0 comments on commit 989ac53

Please sign in to comment.