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]: Ternary operators involving function types fail to be generated. #2647

Open
lum7na opened this issue Jan 27, 2025 · 0 comments
Labels
bug-candidate Bugs reports that are not yet confirmed

Comments

@lum7na
Copy link

lum7na commented Jan 27, 2025

Describe the issue:

The ternary operator r = true ? g : f;, which involves function types, fails to generate IR, causing Slither to crash.

Code example to reproduce the issue:

contract C {
  function f() public {
  }

  function g() public {
  }

  function()  r = true ? g : f;

}

Version:

0.11.0

Relevant log output:

ERROR:SlitherSolcParsing:
Failed to generate IR for C.slitherConstructorVariables. Please open an issue https://github.com/crytic/slither/issues.
C.slitherConstructorVariables (a.sol#1-10):
        r = if true then g else f
Traceback (most recent call last):
...
slither.slithir.exceptions.SlithIRError: Ternary operator are not convertible to SlithIR if true then g else f
ERROR:root:Error:
ERROR:root:Ternary operator are not convertible to SlithIR if true then g else f
ERROR:root:Please report an issue to https://github.com/crytic/slither/issues
@lum7na lum7na added the bug-candidate Bugs reports that are not yet confirmed label Jan 27, 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