Skip to content

Commit

Permalink
Fix crash when a YulPath contains multiple YulIdentifier
Browse files Browse the repository at this point in the history
This happens when there is special member access in some Yul identifier (like
`x.slot` or `x.offset`). I think this issue was introduced when unreserving the
`address` keyword since that changed the structure of `YulPath`. There is a
proper test case in NomicFoundation#1149 already, but without this fix running Sanctuary with
existing rules crashes.
  • Loading branch information
ggiraldez committed Nov 25, 2024
1 parent fe89f8d commit d8419e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion crates/solidity/inputs/language/bindings/rules.msgb
Original file line number Diff line number Diff line change
Expand Up @@ -2265,9 +2265,11 @@ inherit .lexical_scope
edge @path.lexical_scope -> @expr.lexical_scope
}

@path [YulPath @name [YulIdentifier]] {
@path [YulPath] {
node @path.lexical_scope
}

@path [YulPath @name [YulIdentifier]] {
node ref
attr (ref) node_reference = @name

Expand Down

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

0 comments on commit d8419e2

Please sign in to comment.