Commit 42138ac2 authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[flags] Avoid endless lops when enforcing flag implications

Change-Id: Ide8935a02cb64134c3bdeb8b3e38e9a6e043e13c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3610432Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80256}
parent 4837f372
...@@ -841,11 +841,15 @@ bool TriggerImplication(bool premise, const char* premise_name, ...@@ -841,11 +841,15 @@ bool TriggerImplication(bool premise, const char* premise_name,
void FlagList::EnforceFlagImplications() { void FlagList::EnforceFlagImplications() {
flag_hash = 0; flag_hash = 0;
bool changed; bool changed;
int iteration = 0;
do { do {
changed = false; changed = false;
#define FLAG_MODE_DEFINE_IMPLICATIONS #define FLAG_MODE_DEFINE_IMPLICATIONS
#include "src/flags/flag-definitions.h" // NOLINT(build/include) #include "src/flags/flag-definitions.h" // NOLINT(build/include)
#undef FLAG_MODE_DEFINE_IMPLICATIONS #undef FLAG_MODE_DEFINE_IMPLICATIONS
// Make sure flag definitions are not touring complete. A.k.a avoid endless
// loops in case of buggy configurations.
CHECK_LT(iteration++, 1000);
} while (changed); } while (changed);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment