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

[Bug-Candidate]: Slither-mutate; ROR mutator doesn't respect whether the integer is signed #2674

Open
bsamuels453 opened this issue Feb 23, 2025 · 0 comments
Labels
bug-candidate Bugs reports that are not yet confirmed

Comments

@bsamuels453
Copy link
Contributor

bsamuels453 commented Feb 23, 2025

Describe the issue:

slither-mutate generates some mutations that are semantically equivalent in code that performs equality checks between unsigned integers and zero.

Example ROR mutation:
INFO:Slither-Mutate:[ROR] Line 162: 'amount == 0' ==> 'amount <= 0' --> UNCAUGHT

amount is an unsigned integer, so comparing <=0 instead of ==0 is semantically equivalent

Code example to reproduce the issue:

contract Test{
  function deposit( uint256 amount) external  {
    if (amount == 0) {
      revert();
    }
}

Version:

Slither 0.11.0

Relevant log output:

@bsamuels453 bsamuels453 added the bug-candidate Bugs reports that are not yet confirmed label Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-candidate Bugs reports that are not yet confirmed
Projects
None yet
Development

No branches or pull requests

1 participant