Skip to content

Fix: Ast Node Bindings#199

Merged
DaniPopes merged 1 commit intofoundry-rs:mainfrom
TilakMaddy:fix/return-ast-node
Sep 16, 2024
Merged

Fix: Ast Node Bindings#199
DaniPopes merged 1 commit intofoundry-rs:mainfrom
TilakMaddy:fix/return-ast-node

Conversation

@TilakMaddy
Copy link
Contributor

@TilakMaddy TilakMaddy commented Sep 15, 2024

Fix for 2 ast node bindings

  • BinaryOperation can qualify as an expr_node!
  • Return AST Node's function_return_parameters should be made optional because when return is used inside modifiers, the AST generated by solc doesn't include the function_return_parameters field

More context:
I tried using these changes on Aderyn for a while and haven't come across an unrecognized node since :) So I thought I'll share it with ya!

Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

Thanks!

@DaniPopes DaniPopes merged commit 3a9139a into foundry-rs:main Sep 16, 2024
klkvr pushed a commit that referenced this pull request Sep 16, 2024
Fix for 2 ast node bindings

* BinaryOperation can qualify as an `expr_node!`
* Return AST Node's `function_return_parameters` should be made optional
because when return is used inside modifiers, the AST generated by solc
doesn't include the `function_return_parameters` field

More context:
I tried using these changes on
[Aderyn](https://github.com/Cyfrin/aderyn/blob/5c483fdbf1f454ca42c1fd9b85353b0b9241c43a/aderyn_core/src/ast/ast_nodes.rs#L639C1-L645C3)
for a while and haven't come across an unrecognized node since :) So I
thought I'll share it with ya!
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