Skip to content

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

Open
@duckki

Description

@duckki

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcfg

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions