Skip to content

Ignore function node IDs not found when validating parent initializer calls #1137

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

Merged
merged 6 commits into from
Mar 19, 2025

Conversation

ericglau
Copy link
Member

Background:
When checking for issues in parent initializer calls according to #1095, we recursively check initializer functions and the functions that they call.

When an function calls a built-in function, the referenced AST node ID of the built in function may be negative (which was fixed in #1116), or it could be represented as a large positive number as reported in #1128.

We previously only ignored negative numbers, but since there is no way to conclusively identify that a large positive number is negative, we should also ignore when the referenced function node ID is not found.


Testing:
I tested that this works by temporarily removing the checks for negative node IDs and allowing the new error handling to ignore the error. However, we should still keep the checks for negative node IDs for efficiency purposes (e.g. no need to dereference if we know that the id is negative and will not be found).


Fixes #1128

@ericglau ericglau requested a review from CoveMB March 14, 2025 19:55
@ericglau ericglau merged commit 1afeb91 into OpenZeppelin:master Mar 19, 2025
14 checks passed
@ericglau ericglau deleted the 1128 branch March 19, 2025 20:29
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.

ASTDereferencerError: No node with id 4294967278 of type FunctionDefinition
2 participants