Skip to content

Commit 3a9139a

Browse files
authored
Fix: Ast Node Bindings (#199)
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!
1 parent e906f76 commit 3a9139a

File tree

1 file changed

+2
-2
lines changed
  • crates/artifacts/solc/src/ast

1 file changed

+2
-2
lines changed

crates/artifacts/solc/src/ast/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ pub enum AssignmentOperator {
257257
ShlAssign,
258258
}
259259

260-
ast_node!(
260+
expr_node!(
261261
/// A binary operation.
262262
struct BinaryOperation {
263263
common_type: TypeDescriptions,
@@ -938,7 +938,7 @@ stmt_node!(
938938
/// A return statement.
939939
struct Return {
940940
expression: Option<Expression>,
941-
function_return_parameters: usize,
941+
function_return_parameters: Option<usize>,
942942
}
943943
);
944944

0 commit comments

Comments
 (0)