summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAlex Turbov <i.zaufi@gmail.com>2021-08-09 17:35:56 (GMT)
committerAlex Turbov <i.zaufi@gmail.com>2021-08-09 18:05:09 (GMT)
commit61b33c3f4eae3ce81df36c79ec69630cd9fcefdc (patch)
tree8ad558d0d6ac37c02e0c83f3a28b65a37c48aa1b /Source
parent7e3250da2fa0155a8c83b3aadef0407a701f2953 (diff)
downloadCMake-61b33c3f4eae3ce81df36c79ec69630cd9fcefdc.zip
CMake-61b33c3f4eae3ce81df36c79ec69630cd9fcefdc.tar.gz
CMake-61b33c3f4eae3ce81df36c79ec69630cd9fcefdc.tar.bz2
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.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmConditionEvaluator.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmConditionEvaluator.cxx b/Source/cmConditionEvaluator.cxx
index 49189d8..68bc4d8 100644
--- a/Source/cmConditionEvaluator.cxx
+++ b/Source/cmConditionEvaluator.cxx
@@ -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