diff --git a/centipede/BUILD b/centipede/BUILD index 840735e6..4d62b68f 100644 --- a/centipede/BUILD +++ b/centipede/BUILD @@ -584,6 +584,7 @@ cc_library( ":control_flow", ":feature", ":util", + "@com_google_absl//absl/log", "@com_google_absl//absl/log:check", "@com_google_absl//absl/strings", "@com_google_fuzztest//common:logging", diff --git a/centipede/feature_set.h b/centipede/feature_set.h index de28f3b3..81ba5878 100644 --- a/centipede/feature_set.h +++ b/centipede/feature_set.h @@ -22,6 +22,7 @@ #include #include +#include "absl/log/log.h" #include "./centipede/control_flow.h" #include "./centipede/feature.h" #include "./centipede/util.h" @@ -108,6 +109,11 @@ class FeatureSet { // feature. bool ShouldDiscardFeature(feature_t feature) const { size_t domain_id = feature_domains::Domain::FeatureToDomainId(feature); + // TODO(b/385774476): Remove this check once the root cause is fixed. + if (domain_id >= feature_domains::kNumDomains) { + LOG(ERROR) << "Unexpected feature with id: " << feature; + return true; + } return should_discard_domain_.test(domain_id); }