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

slither-mutate: fix AOR mutator #2653

Merged
merged 2 commits into from
Jan 31, 2025
Merged

slither-mutate: fix AOR mutator #2653

merged 2 commits into from
Jan 31, 2025

Conversation

smonicas
Copy link
Collaborator

Before the AOR mutator could crash when an array was accessed through multi levels such as as a value of a mapping because the ir_expression.called.expression would be an Index operator. Removing the specific checks on the Identifier being an ArrayType make it works for all the possible cases with no practical downsides, maybe it could be a problem if there is a library with custom functions called pop and push used with the using-for directive

contract Counter {
    mapping(uint => uint[]) p;

    function s() public {
       p[1].push(2);
   }
}

@smonicas smonicas requested a review from montyly as a code owner January 31, 2025 13:57
@@ -33,8 +33,7 @@ options:
--timeout TIMEOUT Set timeout for test command (by default 30 seconds)
--output-dir OUTPUT_DIR
Name of output directory (by default 'mutation_campaign')
-v, --verbose log mutants that are caught as well as those that are uncaught
-vv, --very-verbose log mutants that are caught, uncaught, and fail to compile. And more!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this removal expected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It was done here but the the CLI arg and README were not updated

@montyly montyly merged commit cacf6f6 into dev Jan 31, 2025
46 checks passed
@montyly montyly deleted the dev-fix-AOR-mutator branch January 31, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants