[tint][fuzzers] Check program is valid

ApplySubstituteOverrides() will replace all `override` variables with `const` values.
The const value may be used by constant expressions, which have a large number of complex validation rules, the resulting program may not pass validation. Don't error in this case.

Bug: chromium:1458674
Change-Id: Icbca8e6a460d3dac7629f995e6662bce01658af0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/140121
Commit-Queue: James Price <jrprice@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: James Price <jrprice@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/src/tint/fuzzers/tint_common_fuzzer.cc b/src/tint/fuzzers/tint_common_fuzzer.cc
index 02d2d4d..dad9e5f 100644
--- a/src/tint/fuzzers/tint_common_fuzzer.cc
+++ b/src/tint/fuzzers/tint_common_fuzzer.cc
@@ -236,7 +236,7 @@
     {
         // Run SubstituteOverride if required
         auto out = ApplySubstituteOverrides(std::move(program));
-        if (!validate_program(out)) {
+        if (!out.IsValid()) {
             return 0;
         }
     }
diff --git a/src/tint/fuzzers/tint_concurrency_fuzzer.cc b/src/tint/fuzzers/tint_concurrency_fuzzer.cc
index f2341a7..8c708ec 100644
--- a/src/tint/fuzzers/tint_concurrency_fuzzer.cc
+++ b/src/tint/fuzzers/tint_concurrency_fuzzer.cc
@@ -49,6 +49,9 @@
     }
 
     program = tint::fuzzers::ApplySubstituteOverrides(std::move(program));
+    if (!program.IsValid()) {
+        return 0;
+    }
 
     tint::inspector::Inspector inspector(&program);
     auto entry_points = inspector.GetEntryPoints();