From 45d0dd13444a8f07d90004ca8ebefdc18498ed62 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 30 Jan 2008 08:37:38 -0500 Subject: BUG: Fix misuse of stl vector that caused definitions to be dropped by cmMakefile::PushScope. --- Source/cmMakefile.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 1abd467..31ce605 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2955,7 +2955,14 @@ std::string cmMakefile::GetListFileStack() void cmMakefile::PushScope() { - this->DefinitionStack.push_back(this->DefinitionStack.back()); + // Get the index of the next stack entry. + std::vector::size_type index = this->DefinitionStack.size(); + + // Allocate a new stack entry. + this->DefinitionStack.push_back(DefinitionMap()); + + // Copy the previous top to the new top. + this->DefinitionStack[index] = this->DefinitionStack[index-1]; } void cmMakefile::PopScope() -- cgit v0.12