diff --git a/src/tint/fuzzers/tint_common_fuzzer.cc b/src/tint/fuzzers/tint_common_fuzzer.cc index 9e12a12173..1c24f35f28 100644 --- a/src/tint/fuzzers/tint_common_fuzzer.cc +++ b/src/tint/fuzzers/tint_common_fuzzer.cc @@ -303,6 +303,11 @@ void CommonFuzzer::RunInspector(Program* program) { inspector::Inspector inspector(program); diagnostics_ = program->Diagnostics(); + if (!program->IsValid()) { + // It's not safe to use the inspector on invalid programs. + return; + } + auto entry_points = inspector.GetEntryPoints(); CHECK_INSPECTOR(program, inspector);