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

handle 'null' try clause parameters, which can arise in older solc ve… #18

Merged
merged 1 commit into from
Jan 14, 2023

Conversation

kevinclancy
Copy link

Notes

In older versions of solc, the generated json ast contains the value null to convey lack of return variables for a try clause. This is translated to None in python. In my recent changes to try/catch IR, I neglected to handle this.

Testing

Try running Slither on the following file with an without these changes:

pragma solidity ^0.6.2;

contract Test {
    function bar() external {}
}

contract Baz {
    function foo(Test a) external {
        try a.bar() {} catch {}
    }
}

Without the changes, an exception is raised. With the changes, Slither runs without errors.

Related Issue

https://github.com/CertiKProject/slither-task/issues/220

@kevinclancy kevinclancy requested a review from duckki January 14, 2023 01:55
@kevinclancy kevinclancy self-assigned this Jan 14, 2023
@duckki duckki merged commit 9845a2f into certik Jan 14, 2023
@duckki duckki deleted the fix-try-missing-params branch January 27, 2023 22:15
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