crytic / crytic/slither

Control flow for short-circuiting operators

Open
#294 0 comments 1 reaction 0 assignees View on GitHub
cfg
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

It seems like slithIR does not handle control flow for short-circuiting operators (&&, ||)

Example:
```
Expression: e = (a == 1) || (((c = 5) + b) == 6)
IRs:
TMP_1(bool) = a == 1
c(uint256) := 5(uint256)
TMP_2(uint256) = c + b
TMP_3(bool) = TMP_2 == 6
TMP_4(bool) = TMP_1 || TMP_3
e(bool) := TMP_4(bool)
```

This basic block here is incorrect, as c should only be getting set to 5 when a!=1

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.