cmStateSnapshot: Invert CanPopPolicyScope return value to match name

This commit is contained in:
Brad King
2020-06-12 06:52:47 -04:00
parent 0a7a4665be
commit fcea4a3b45
2 changed files with 2 additions and 2 deletions

View File

@@ -4605,7 +4605,7 @@ void cmMakefile::PopSnapshot(bool reportError)
// cmStateSnapshot manages nested policy scopes within it.
// Since the scope corresponding to the snapshot is closing,
// reject any still-open nested policy scopes with an error.
while (!this->StateSnapshot.CanPopPolicyScope()) {
while (this->StateSnapshot.CanPopPolicyScope()) {
if (reportError) {
this->IssueMessage(MessageType::FATAL_ERROR,
"cmake_policy PUSH without matching POP");

View File

@@ -148,7 +148,7 @@ bool cmStateSnapshot::PopPolicy()
bool cmStateSnapshot::CanPopPolicyScope()
{
return this->Position->Policies == this->Position->PolicyScope;
return this->Position->Policies != this->Position->PolicyScope;
}
void cmStateSnapshot::SetPolicy(cmPolicies::PolicyID id,