diff --git a/Source/cmState.cxx b/Source/cmState.cxx index ce9ff323b..363d2bf5d 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -1081,7 +1081,8 @@ cmState::Snapshot cmState::Snapshot::GetCallStackParent() const Snapshot snapshot; PositionType parentPos = this->Position; - while(parentPos->SnapshotType == cmState::PolicyScopeType) + while (parentPos->SnapshotType == cmState::PolicyScopeType || + parentPos->SnapshotType == cmState::VariableScopeType) { ++parentPos; } @@ -1092,7 +1093,8 @@ cmState::Snapshot cmState::Snapshot::GetCallStackParent() const } ++parentPos; - while(parentPos->SnapshotType == cmState::PolicyScopeType) + while (parentPos->SnapshotType == cmState::PolicyScopeType || + parentPos->SnapshotType == cmState::VariableScopeType) { ++parentPos; }