AST fuzzer: fix change unary operator mutation

The "change unary operator" mutation now ignores the indirection
operator.

Fixes: tint:1631
Change-Id: Ie1878d8bf65807f3319858b62292bc97fba81044
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/97680
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Alastair Donaldson <allydonaldson@googlemail.com>
diff --git a/src/tint/fuzzers/tint_ast_fuzzer/mutation_finders/change_unary_operators.cc b/src/tint/fuzzers/tint_ast_fuzzer/mutation_finders/change_unary_operators.cc
index fb3fb96..c8dff2c 100644
--- a/src/tint/fuzzers/tint_ast_fuzzer/mutation_finders/change_unary_operators.cc
+++ b/src/tint/fuzzers/tint_ast_fuzzer/mutation_finders/change_unary_operators.cc
@@ -50,6 +50,12 @@
             continue;
         }
 
+        // Only complement and negation operators can be swapped.
+        if (!(unary_expr->op == ast::UnaryOp::kComplement ||
+              unary_expr->op == ast::UnaryOp::kNegation)) {
+            continue;
+        }
+
         result.push_back(std::make_unique<MutationChangeUnaryOperator>(
             node_id_map->GetId(unary_expr),
             MutationChangeUnaryOperator::ToggleOperator(unary_expr->op)));