Skip to content

Commit

Permalink
Ignore unexpected feature ids.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 728797411
  • Loading branch information
hadi88 authored and copybara-github committed Feb 19, 2025
1 parent 1d61720 commit 39b4dd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions centipede/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions centipede/feature_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <ostream>
#include <string>

#include "absl/log/log.h"
#include "./centipede/control_flow.h"
#include "./centipede/feature.h"
#include "./centipede/util.h"
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 39b4dd7

Please sign in to comment.