Commit f4f670f
committed
fix: filter non-arithmetic operators in ArithmeticMutator.CanMutate
ArithmeticMutator.CanMutate returned true for all BinaryExpr nodes
including conditional (==, !=) and logical (&&, ||) operators.
While getArithmeticMutations returned nil for these, the lack of
filtering caused unnecessary processing and could lead to bugs
when adding new mutators.
Add isArithmeticOp and isArithmeticAssignOp helper methods to
properly filter only arithmetic operators, consistent with how
ConditionalMutator and LogicalMutator handle their own operators.1 parent 37ac995 commit f4f670f
1 file changed
+21
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
40 | 58 | | |
41 | 59 | | |
42 | 60 | | |
| |||
0 commit comments