[cmake-commits] king committed cmMakefile.cxx 1.431 1.432

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Jan 30 08:37:40 EST 2008


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv9983/Source

Modified Files:
	cmMakefile.cxx 
Log Message:
BUG: Fix misuse of stl vector that caused definitions to be dropped by cmMakefile::PushScope.


Index: cmMakefile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefile.cxx,v
retrieving revision 1.431
retrieving revision 1.432
diff -u -d -r1.431 -r1.432
--- cmMakefile.cxx	28 Jan 2008 13:38:35 -0000	1.431
+++ cmMakefile.cxx	30 Jan 2008 13:37:38 -0000	1.432
@@ -2955,7 +2955,14 @@
 
 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()



More information about the Cmake-commits mailing list