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

Support .address access in Yul paths #945

Merged
merged 4 commits into from
Apr 25, 2024

Conversation

Xanewok
Copy link
Contributor

@Xanewok Xanewok commented Apr 24, 2024

Found with the Sanctuary run on Arbitrum: https://github.com/NomicFoundation/slang/actions/runs/8803528884
This fixes the last bug in Arbitrum data set: https://github.com/Xanewok/slang/actions/runs/8813993801

Implemented in ethereum/solidity#12016 (0.8.10), grammar updated in ethereum/solidity#12545.

This matches the upstream grammar, however:

  • this is more relaxed and parses code that would be rejected by validation, i.e. <built-in> := ...
  • we do get a bit of noise, since most of the paths will never contain the built-in.

I've also changed YulidentifierPath to YulPath to match upstream and since it's not only an identifier anymore.

This also includes a patch level bump - while technically it's breaking the CST shape, I'd consider this a (hopefully last?) grammar bug fix that might justify the patch level.

@Xanewok Xanewok requested a review from a team as a code owner April 24, 2024 09:05
Copy link

changeset-bot bot commented Apr 24, 2024

🦋 Changeset detected

Latest commit: 7587230

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nomicfoundation/slang Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Xanewok Xanewok changed the title Yul function pointer Support .address access in Yul paths Apr 24, 2024
@Xanewok
Copy link
Contributor Author

Xanewok commented Apr 24, 2024

My first instinct was to match the upstream grammar but I figured it might be best to just support address for now as it conveys the intent better and we don't get so relaxed when parsing built-ins we know are outright not supported in that position.

@Xanewok Xanewok added this pull request to the merge queue Apr 25, 2024
Merged via the queue into NomicFoundation:main with commit e8f80d8 Apr 25, 2024
1 check passed
@Xanewok Xanewok deleted the yul-function-pointer branch April 25, 2024 11:32
@github-actions github-actions bot mentioned this pull request Apr 25, 2024
github-merge-queue bot pushed a commit that referenced this pull request Apr 25, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## @nomicfoundation/[email protected]

### Patch Changes

- [#948](#948)
[`ce88cb7`](ce88cb7)
Thanks [@Xanewok](https://github.com/Xanewok)! - Restrict the grammar to
correctly only allow an identifier in Yul variable declaration

- [#945](#945)
[`e8f80d8`](e8f80d8)
Thanks [@Xanewok](https://github.com/Xanewok)! - Support `.address`
built-in access in Yul paths

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants