Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix InlineAssembly schema errors #50

Merged
merged 5 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

### 0.4.58 (2024-08-29)

- Fixed `YulFunctionDefinition.parameters` and `returnVariables`: made optional, used when empty.
- Fixed `InlineAssembly.externalReferences[].suffix`: added `'length'` option.

### 0.4.57 (2024-07-16)

- Fixed `ModifierDefinition.body`: made nullable to support Solidity 0.6.7 virtual modifiers with empty body.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "solidity-ast",
"version": "0.4.57",
"version": "0.4.58",
"description": "Solidity AST schema and type definitions",
"author": "Francisco Giordano <[email protected]>",
"repository": "github:OpenZeppelin/solidity-ast",
Expand Down
6 changes: 3 additions & 3 deletions 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 Expand Up @@ -817,8 +817,8 @@ const schema = {
YulFunctionDefinition: {
body: ref('YulBlock'),
name: string,
parameters: array(ref('YulTypedName')),
returnVariables: array(ref('YulTypedName')),
parameters: optional(array(ref('YulTypedName'))),
returnVariables: optional(array(ref('YulTypedName'))),
},

YulIdentifier: {
Expand Down
4 changes: 4 additions & 0 deletions test/sources/asm-0.6.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ contract Asm {
assembly {
let x := s_slot
let y := s_offset

function fail() {
revert(0, 0)
}
}
}
}
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
}
}
}
4 changes: 4 additions & 0 deletions test/sources/asm-0.7.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ contract Asm {
assembly {
let x := s.slot
let y := s.offset

function fail() {
revert(0, 0)
}
}
}
}
Loading