Closed aviggiano closed 1 month ago
I think this is a limitation caused by transforming Solidity ternary expressions into if-else statements in slither's intermediate representation and not having the right source mapping. That is, the mutation attempts to create if(true)
by modifying the conditions source offset but doesn't handle writing a ternary as true ? ... : ...
Slither mutate has been overhauled since this issue was opened, check out the release notes for slither v0.10.2 for more info. Give it another test drive! I think you'll like it 😁
Note: while some mutants may still be generated which fail to compile, they're handled more gracefully now because slither-mutate quietly discards and does not include them to the output or final summary statistics.
Describe the issue:
I am using
slither-mutate
on Uniswap v2, and sometimes it creates a mutant that cannot be compiled.For example, take the following a change made on the
UniswapV2Pair.sol
contract:At the very end, it replaced ternary assignment/declaration variables by
true;
. The problem is that later the declared variables (amount0In
andamount1In
) are used in a comparison (require ...
), which makes the compilation fail:Code example to reproduce the issue:
UniswapV2Pair.sol
Version:
0.9.2
Relevant log output: