Skip to content

Commit

Permalink
Merge pull request #2653 from crytic/dev-fix-AOR-mutator
Browse files Browse the repository at this point in the history
slither-mutate: fix AOR mutator
  • Loading branch information
montyly authored Jan 31, 2025
2 parents c36ed42 + c61d06b commit cacf6f6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
3 changes: 1 addition & 2 deletions slither/tools/mutator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
-v, --verbose log mutants that are caught, uncaught, and fail to compile
--mutators-to-run MUTATORS_TO_RUN
mutant generators to run
--contract-names CONTRACT_NAMES
Expand Down
2 changes: 1 addition & 1 deletion slither/tools/mutator/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def parse_args() -> argparse.Namespace:
parser.add_argument(
"-v",
"--verbose",
help="log mutants that are caught as well as those that are uncaught",
help="log mutants that are caught, uncaught, and fail to compile",
action="store_true",
default=False,
)
Expand Down
9 changes: 0 additions & 9 deletions slither/tools/mutator/mutators/AOR.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
from slither.slithir.operations import Binary, BinaryType
from slither.tools.mutator.utils.patch import create_patch_with_line
from slither.tools.mutator.mutators.abstract_mutator import AbstractMutator
from slither.core.variables.variable import Variable
from slither.core.expressions.unary_operation import UnaryOperation
from slither.core.expressions.call_expression import CallExpression
from slither.core.expressions.member_access import MemberAccess
from slither.core.expressions.identifier import Identifier
from slither.core.solidity_types.array_type import ArrayType

arithmetic_operators = [
BinaryType.ADDITION,
Expand Down Expand Up @@ -42,9 +39,6 @@ def _mutate(self) -> Dict:
isinstance(ir_expression, CallExpression)
and isinstance(ir_expression.called, MemberAccess)
and ir_expression.called.member_name == "pop"
and isinstance(ir_expression.called.expression, Identifier)
and isinstance(ir_expression.called.expression.value, Variable)
and isinstance(ir_expression.called.expression.value.type, ArrayType)
):
continue

Expand All @@ -58,9 +52,6 @@ def _mutate(self) -> Dict:
if isinstance(ir_expression, CallExpression)
and isinstance(ir_expression.called, MemberAccess)
and ir_expression.called.member_name == "push"
and isinstance(ir_expression.called.expression, Identifier)
and isinstance(ir_expression.called.expression.value, Variable)
and isinstance(ir_expression.called.expression.value.type, ArrayType)
else node.irs
)

Expand Down

0 comments on commit cacf6f6

Please sign in to comment.