Skip to content

Commit

Permalink
add 'length' to InlineAssembly.externalReferences[].suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Aug 26, 2024
1 parent 99d606d commit 3518d5b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion scripts/build-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'))),
},
Expand Down
9 changes: 9 additions & 0 deletions test/sources/asm-0.7.5.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pragma solidity >=0.7.5;

contract Asm {
function foo(bytes calldata b) external {
assembly {
let z := b.length
}
}
}
2 changes: 1 addition & 1 deletion test/sources/asm-0.7.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3518d5b

Please sign in to comment.