diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b106df..398190f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### 0.4.58 (2024-08-26) - Fixed `YulFunctionDefinition.parameters` and `returnVariables`: made optional, used when empty. +- Fixed `InlineAssembly.externalReferences[].suffix`: added `'length'` option. ### 0.4.57 (2024-07-16) diff --git a/scripts/build-schema.js b/scripts/build-schema.js index 2c2d2c4..b1d37ca 100644 --- a/scripts/build-schema.js +++ b/scripts/build-schema.js @@ -498,7 +498,7 @@ const schema = { isSlot: boolean, src: ref('SourceLocation'), valueSize: integer, - suffix: optional(literal('slot', 'offset')), + suffix: optional(literal('slot', 'offset', 'length')), })), flags: optional(array(literal('memory-safe'))), }, diff --git a/test/sources/asm-0.7.5.sol b/test/sources/asm-0.7.5.sol new file mode 100644 index 0000000..896b974 --- /dev/null +++ b/test/sources/asm-0.7.5.sol @@ -0,0 +1,9 @@ +pragma solidity >=0.7.5; + +contract Asm { + function foo(bytes calldata b) external { + assembly { + let z := b.length + } + } +} diff --git a/test/sources/asm-0.7.sol b/test/sources/asm-0.7.sol index b41c697..c9dcf8d 100644 --- a/test/sources/asm-0.7.sol +++ b/test/sources/asm-0.7.sol @@ -3,7 +3,7 @@ pragma solidity >=0.7; contract Asm { uint s; - function foo() external { + function foo(bytes calldata b) external { assembly { let x := s.slot let y := s.offset