diff options
author | Brad King <brad.king@kitware.com> | 2015-11-24 19:44:19 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-11-25 15:37:59 (GMT) |
commit | f21dc4a81c05c79b873c9918f6fe8aff4bf02133 (patch) | |
tree | 67bfdeb7307e0c358683736b12f75519b5a1b180 /Source/cmState.cxx | |
parent | bc1d3a8a8783848016ef12044a02a28b620c41a0 (diff) | |
download | CMake-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.cxx | 2 |
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; } |