Commit 2e28c619 authored by Brad King's avatar Brad King
Browse files

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).
parent b4a2ada2
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment