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: Only allow an identifier in the Yul variable declaration position #948

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

Xanewok
Copy link
Member

@Xanewok Xanewok commented Apr 25, 2024

Previously, Yul identifiers could have dots in the name but that's not the case starting from 0.7. As such, we need to disallow these forms for the variable declaration and instead only accept the identifier, as is done by the upstream grammar.

Thanks @OmarTawfik for finding this!

Previously, Yul identifiers could have dots in the name but that's not
the case starting from 0.7. As such, we need to disallow these forms for
the variable declaration and instead only accept the identifier, as is
done by the upstream grammar.
@Xanewok Xanewok requested a review from a team as a code owner April 25, 2024 12:07
Copy link

changeset-bot bot commented Apr 25, 2024

🦋 Changeset detected

Latest commit: 25eacd8

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

# This file is generated automatically by infrastructure scripts. Please don't edit by hand.

Source: >
1 │ let a.b.c := 1 │ 0..14
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested with dissect and we now exactly match this case with solc: this was allowed since 0.5.8 until 0.7, where we started disallowing dots in user-defined identifiers.

@Xanewok Xanewok added this pull request to the merge queue Apr 25, 2024
Merged via the queue into NomicFoundation:main with commit ce88cb7 Apr 25, 2024
1 check passed
@Xanewok Xanewok deleted the fix-yul-variable-declaration branch April 25, 2024 14:13
@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/slang@0.14.2

### 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