[flags] Avoid endless lops when enforcing flag implications

Change-Id: Ide8935a02cb64134c3bdeb8b3e38e9a6e043e13c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3610432
Reviewed-by: Patrick Thier <pthier@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80256}
This commit is contained in:
Camillo Bruni 2022-04-28 14:47:59 +02:00 committed by V8 LUCI CQ
parent 4837f37279
commit 42138ac2e9

View File

@ -841,11 +841,15 @@ bool TriggerImplication(bool premise, const char* premise_name,
void FlagList::EnforceFlagImplications() {
flag_hash = 0;
bool changed;
int iteration = 0;
do {
changed = false;
#define FLAG_MODE_DEFINE_IMPLICATIONS
#include "src/flags/flag-definitions.h" // NOLINT(build/include)
#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);
}