From f21dc4a81c05c79b873c9918f6fe8aff4bf02133 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 24 Nov 2015 14:44:19 -0500 Subject: 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. --- Source/cmState.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v0.12