mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
cmake: avoid exception when printing "changed variables" message
If the changed cache variable was a list then this processing may attempt to access beyond the last item in the list. Instead skip printing the non-existing value and backup one to finish the loop.
This commit is contained in:
+7
-2
@@ -1390,8 +1390,13 @@ int cmake::HandleDeleteCacheVariables(const std::string& var)
|
||||
save.key = *i;
|
||||
warning << *i << "= ";
|
||||
i++;
|
||||
save.value = *i;
|
||||
warning << *i << "\n";
|
||||
if (i != argsSplit.end()) {
|
||||
save.value = *i;
|
||||
warning << *i << "\n";
|
||||
} else {
|
||||
warning << "\n";
|
||||
i -= 1;
|
||||
}
|
||||
cmProp existingValue = this->State->GetCacheEntryValue(save.key);
|
||||
if (existingValue) {
|
||||
save.type = this->State->GetCacheEntryType(save.key);
|
||||
|
||||
Reference in New Issue
Block a user