mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 20:29:49 -05:00
Fix: Regression in the cmConditionEvaluator::HandleLevel0
As reported in the BUG #22524, mismatched parenthesis reported differently for `while()` and `if()`. The problem was in the double loop (over "handlers" and the arguments), where the outer loop didn't check the result of the running handler.
This commit is contained in:
@@ -260,11 +260,17 @@ bool cmConditionEvaluator::IsTrue(
|
||||
for (auto fn : handlers) {
|
||||
// Call the reducer 'till there is anything to reduce...
|
||||
// (i.e., if after an iteration the size becomes smaller)
|
||||
auto levelResult = true;
|
||||
for (auto beginSize = newArgs.size();
|
||||
(this->*fn)(newArgs, errorString, status) &&
|
||||
(levelResult = (this->*fn)(newArgs, errorString, status)) &&
|
||||
newArgs.size() < beginSize;
|
||||
beginSize = newArgs.size()) {
|
||||
}
|
||||
|
||||
if (!levelResult) {
|
||||
// NOTE `errorString` supposed to be set already
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// now at the end there should only be one argument left
|
||||
|
||||
Reference in New Issue
Block a user