mirror of https://github.com/crytic/slither
Merge pull request #1306 from crytic/vladyan18-fix-ternary-with-type
Add check ElementaryTypeNameExpression in copy_expressionpull/1308/head
commit
1a6976a0ec
Binary file not shown.
@ -0,0 +1,5 @@ |
||||
{ |
||||
"TernaryWithMax": { |
||||
"f(bool)": "digraph{\n0[label=\"Node Type: ENTRY_POINT 0\n\"];\n0->2;\n2[label=\"Node Type: IF 2\n\"];\n2->3[label=\"True\"];\n2->4[label=\"False\"];\n3[label=\"Node Type: EXPRESSION 3\n\"];\n3->5;\n4[label=\"Node Type: EXPRESSION 4\n\"];\n4->5;\n5[label=\"Node Type: END_IF 5\n\"];\n}\n" |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
contract TernaryWithMax { |
||||
function f( |
||||
bool condition |
||||
) external returns(uint256 res) { |
||||
res = type(uint256).max / (condition ? 10 : 1) ; |
||||
} |
||||
} |
Loading…
Reference in new issue