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

Exception: Ternary operation not handled #1490

Closed
selimekim94 opened this issue Dec 3, 2022 · 2 comments
Closed

Exception: Ternary operation not handled #1490

selimekim94 opened this issue Dec 3, 2022 · 2 comments

Comments

@selimekim94
Copy link

Describe the issue:

Slither crashes when analyzing this contract

--> crytic-export/etherscan-contracts/0x8214de517905Baa0b4b3ca06050AAD8fe31e460F-TehRocket.sol:260:5:
|
260 | function min(uint256 a, uint256 b) private view returns (uint256){
| ^ (Relevant source part starts here and spans across multiple lines).

Code example to reproduce the issue:

function min(uint256 a, uint256 b) private view returns (uint256){
return (a>b)?b:a;
}

Version:

0.9.1

Relevant log output:

No response

@selimekim94 selimekim94 added the bug-candidate Bugs reports that are not yet confirmed label Dec 3, 2022
@0xalpharush 0xalpharush added bug Something isn't working duplicate This issue or pull request already exists Need more info and removed bug-candidate Bugs reports that are not yet confirmed duplicate This issue or pull request already exists bug Something isn't working labels Dec 3, 2022
@0xalpharush
Copy link
Contributor

Can you share the error message? I can run the 0.9.1 on this contract without any error and the ternary conversion in the IR looks fine to me at first glance. (I had previously commented but I was on a dev branch related to ternary and the issue is related to my modifications.)

@0xPhaze
Copy link

0xPhaze commented Dec 27, 2022

contract Contract {
    uint256 constant a = 1 < 3 ? 1 : 3;
}

throws

$ slither .
Exception: Ternary operator are not convertible to SlithIR if 1 < 3 then 1 else 3`
$ slither --version
0.9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants