summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-24 14:44:19 -0500
committerBrad King <brad.king@kitware.com>2015-11-25 10:37:59 -0500
commitf21dc4a81c05c79b873c9918f6fe8aff4bf02133 (patch)
tree67bfdeb7307e0c358683736b12f75519b5a1b180
parentbc1d3a8a8783848016ef12044a02a28b620c41a0 (diff)
downloadcmake-f21dc4a81c05c79b873c9918f6fe8aff4bf02133.tar.gz
cmState: Avoid accumulating policy stack storage for short-lived scopes
We enforce policy push/pop balance around any scope that pushes/pops a snapshot. Therefore a snapshot may never reference entries of PolicyStack that were created in nested scopes. Free storage of short-lived policy stack entries when they are popped.
-rw-r--r--Source/cmState.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 3c96d465d0..f9e96f1025 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -1124,7 +1124,7 @@ bool cmState::Snapshot::PopPolicy()
{
return false;
}
- ++pos->Policies;
+ pos->Policies = this->State->PolicyStack.Pop(pos->Policies);
return true;
}