summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-24 14:05:43 -0500
committerBrad King <brad.king@kitware.com>2015-11-24 14:09:27 -0500
commit2e28c619f8997a2b86c72b53659be371ff10a790 (patch)
tree316b958d882aa7a9f6aace775b00ce90639dfa52
parentb4a2ada297214119647b26df8abe394cd73ca53a (diff)
downloadcmake-2e28c619f8997a2b86c72b53659be371ff10a790.tar.gz
cmState: Skip variable scope snapshots to avoid call stack duplicates
Since commit v3.4.0-rc1~179^2~1 (cmState: Add a VariableScope snapshot type, 2015-08-23) the snapshot stack may have a VariableScopeType entry. Skip over these when constructing the call stack, just as we do for policy scopes. Otherwise we report the command causing the variable scope to be entered twice (e.g. find_package while loading a package version file).
-rw-r--r--Source/cmState.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index ce9ff323b8..363d2bf5d2 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;
}