[Cmake-commits] CMake branch, next, updated. v3.5.2-1056-g59d754d
Brad King
brad.king at kitware.com
Thu Apr 21 10:15:08 EDT 2016
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 59d754def532ee6fdb086a28ce1a77b61146c47a (commit)
via 33acf8893ac1406946c18ab671ff3a0308da85fa (commit)
from 529bab6793427b69f0e122652ec1d59b6cafe803 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=59d754def532ee6fdb086a28ce1a77b61146c47a
commit 59d754def532ee6fdb086a28ce1a77b61146c47a
Merge: 529bab6 33acf88
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 21 10:15:07 2016 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Apr 21 10:15:07 2016 -0400
Merge topic 'autogen-updates' into next
33acf889 Autogen: Fix for unsafe NameCollisionTest() method
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=33acf8893ac1406946c18ab671ff3a0308da85fa
commit 33acf8893ac1406946c18ab671ff3a0308da85fa
Author: Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Thu Apr 21 15:50:53 2016 +0200
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 21 10:13:30 2016 -0400
Autogen: Fix for unsafe NameCollisionTest() method
In the old version the call to std::map::erase()
invalidates both bit _and_ ait.
The new version does not call erase() but works on a const std::map.
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 60e26b4..3c6db2d 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1554,32 +1554,27 @@ bool cmQtAutoGenerators::NameCollisionTest(
const std::map<std::string, std::string >& genFiles,
std::multimap<std::string, std::string>& collisions)
{
- typedef std::map<std::string, std::string>::iterator Iter;
+ typedef std::map<std::string, std::string>::const_iterator Iter;
typedef std::map<std::string, std::string>::value_type VType;
- // Create local copy
- std::map<std::string, std::string > localGen ( genFiles );
- for(Iter ait = localGen.begin(); ait != localGen.end(); ++ait )
+ for(Iter ait = genFiles.begin(); ait != genFiles.end(); ++ait )
{
- bool skip_aname ( false );
- Iter bit = (++Iter(ait));
- while ( bit != localGen.end() )
+ bool first_match ( true );
+ for (Iter bit = (++Iter(ait)); bit != genFiles.end(); ++bit)
{
- if(ait->second == bit->second)
- {
- if ( !skip_aname )
- {
- skip_aname = true;
- collisions.insert(VType(ait->second, ait->first));
- }
- collisions.insert(VType(bit->second, bit->first));
- Iter old = bit;
- ++bit;
- localGen.erase(old);
- }
- else
+ if(ait->second == bit->second)
+ {
+ if (first_match)
{
- ++bit;
+ if (collisions.find(ait->second) != collisions.end())
+ {
+ // We already know of this collision from before
+ break;
+ }
+ collisions.insert(VType(ait->second, ait->first));
+ first_match = false;
}
+ collisions.insert(VType(bit->second, bit->first));
+ }
}
}
-----------------------------------------------------------------------
Summary of changes:
Source/cmQtAutoGenerators.cxx | 37 ++++++++++++++++---------------------
1 file changed, 16 insertions(+), 21 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list