Skip to content

[Bug]: revert does not stop control flow #1708

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

Open
duckki opened this issue Mar 4, 2023 · 1 comment · May be fixed by #1709
Open

[Bug]: revert does not stop control flow #1708

duckki opened this issue Mar 4, 2023 · 1 comment · May be fixed by #1709
Labels
bug Something isn't working cfg

Comments

@duckki
Copy link

duckki commented Mar 4, 2023

Describe the issue:

Slither doesn't remove the outgoing control flow edges from expression nodes that call revert functions, as it does with throw statement.

Code example to reproduce the issue:

pragma solidity 0.8.13;

contract A {

    function test(uint a) external returns(bool) {
        if (a < 50) return true;
        revert("a greater than 50");
        return false;
    }
}

CFG:
222575255-d8abef25-2049-4f2e-bd9b-98613accfe0c

The edge from revert node to return false node is wrong.

Version:

0.9.2

Relevant log output:

No response

@duckki duckki added the bug-candidate Bugs reports that are not yet confirmed label Mar 4, 2023
@duckki duckki linked a pull request Mar 4, 2023 that will close this issue
@duckki
Copy link
Author

duckki commented Mar 4, 2023

Proposed fix PR: #1709

@0xalpharush 0xalpharush added bug Something isn't working and removed bug-candidate Bugs reports that are not yet confirmed labels Mar 6, 2023
@0xalpharush 0xalpharush changed the title [Bug-Candidate]: revert does not stop control flow [Bug]: revert does not stop control flow Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cfg
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants