BUG: Fix misuse of stl vector that caused definitions to be dropped by cmMakefile::PushScope.

This commit is contained in:
Brad King 2008-01-30 08:37:38 -05:00
parent d2f901bebf
commit 45d0dd1344
1 changed files with 8 additions and 1 deletions

View File

@ -2955,7 +2955,14 @@ std::string cmMakefile::GetListFileStack()
void cmMakefile::PushScope() 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() void cmMakefile::PopScope()