crytic / crytic/slither

[Bug]: `revert` does not stop control flow

Open
#1,708 1 comment 0 reactions 0 assignees View on GitHub
bug cfg
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

### 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:

```solidity
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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.