crytic / crytic/slither

[Bug-Candidate]: redundant control flow edge after try block

Open
#2,490 2 comments 0 reactions 0 assignees View on GitHub
bug-candidate
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue:

when I print the cfg, it gives an edge from node 1 to node 8 (from try head to b += 123)

### Code example to reproduce the issue:

```solidity
pragma solidity ^0.8.0;

contract D{
function divide(uint256 a, uint256 b) public returns (uint256) {
require(b != 0, "Division by zero");
return a / b;
}
function safeDivide(uint256 a, uint256 b) public returns (uint256, string memory) {
try this.divide(a, b) returns (uint256 result) {
a++;
} catch Error(string memory reason) {
b++;
} catch (bytes memory) {
a += 8;
}
b+=123;
}
}
```

### Version:

0.10.3

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