summaryrefslogtreecommitdiffstats
path: root/Source/cmState.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-11-24 19:44:19 (GMT)
committerBrad King <brad.king@kitware.com>2015-11-25 15:37:59 (GMT)
commitf21dc4a81c05c79b873c9918f6fe8aff4bf02133 (patch)
tree67bfdeb7307e0c358683736b12f75519b5a1b180 /Source/cmState.cxx
parentbc1d3a8a8783848016ef12044a02a28b620c41a0 (diff)
downloadCMake-f21dc4a81c05c79b873c9918f6fe8aff4bf02133.zip
CMake-f21dc4a81c05c79b873c9918f6fe8aff4bf02133.tar.gz
CMake-f21dc4a81c05c79b873c9918f6fe8aff4bf02133.tar.bz2
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.
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r--Source/cmState.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index 3c96d46..f9e96f1 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;
}