diff options
author | Brad King <brad.king@kitware.com> | 2008-01-30 13:37:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-30 13:37:38 (GMT) |
commit | 45d0dd13444a8f07d90004ca8ebefdc18498ed62 (patch) | |
tree | 1a8c1423d483c6022e57cc7e3212435a37c0ac08 /Source/cmMakefile.cxx | |
parent | d2f901bebfe0f57d68a518c420512d27e23b6ce5 (diff) | |
download | CMake-45d0dd13444a8f07d90004ca8ebefdc18498ed62.zip CMake-45d0dd13444a8f07d90004ca8ebefdc18498ed62.tar.gz CMake-45d0dd13444a8f07d90004ca8ebefdc18498ed62.tar.bz2 |
BUG: Fix misuse of stl vector that caused definitions to be dropped by cmMakefile::PushScope.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
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<DefinitionMap>::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() |