[Cmake-commits] CMake branch, next, updated. v2.8.9-1096-g9506108

Stephen Kelly steveire at gmail.com
Mon Oct 15 09:37:23 EDT 2012


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  95061084ebc03d5902587f48a32dd03fd198c99b (commit)
       via  0c1379b8c79f9e923bdb8356f361428ddf712c50 (commit)
       via  929956f6d085e1b2a05b3f1ae46cdd0db3347db9 (commit)
      from  3123794d5cf80a24114193eadede2fd1e3300a0e (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 -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95061084ebc03d5902587f48a32dd03fd198c99b
commit 95061084ebc03d5902587f48a32dd03fd198c99b
Merge: 3123794 0c1379b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 15 09:37:14 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon Oct 15 09:37:14 2012 -0400

    Merge topic 'generator-expression-bug-fixes' into next
    
    0c1379b Add some more asserts to verify code-sanity.
    929956f Break if there are no more commas in the container


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0c1379b8c79f9e923bdb8356f361428ddf712c50
commit 0c1379b8c79f9e923bdb8356f361428ddf712c50
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 15 15:34:43 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 15 15:35:26 2012 +0200

    Add some more asserts to verify code-sanity.

diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx
index 64d992a..7a8fc51 100644
--- a/Source/cmGeneratorExpressionParser.cxx
+++ b/Source/cmGeneratorExpressionParser.cxx
@@ -106,6 +106,7 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
                 startToken->Content, this->it->Content
                                     - startToken->Content
                                     + this->it->Length);
+    assert(this->it != this->Tokens.end());
     ++this->it;
     --this->NestingLevel;
     content->SetIdentifier(identifier);
@@ -122,6 +123,7 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
     {
     colonToken = this->it;
     parameters.resize(parameters.size() + 1);
+    assert(this->it != this->Tokens.end());
     ++this->it;
 
     while (this->it != this->Tokens.end() &&
@@ -129,12 +131,14 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
       {
       commaTokens.push_back(this->it);
       parameters.resize(parameters.size() + 1);
+      assert(this->it != this->Tokens.end());
       ++this->it;
       }
     while (this->it != this->Tokens.end() &&
            this->it->TokenType == cmGeneratorExpressionToken::ColonSeparator)
       {
       extendText(*(parameters.end() - 1), this->it);
+      assert(this->it != this->Tokens.end());
       ++this->it;
       }
     while (this->it != this->Tokens.end() &&
@@ -150,12 +154,14 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
         {
         commaTokens.push_back(this->it);
         parameters.resize(parameters.size() + 1);
+        assert(this->it != this->Tokens.end());
         ++this->it;
         }
       while (this->it != this->Tokens.end() &&
              this->it->TokenType == cmGeneratorExpressionToken::ColonSeparator)
         {
         extendText(*(parameters.end() - 1), this->it);
+        assert(this->it != this->Tokens.end());
         ++this->it;
         }
       }
@@ -163,6 +169,7 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
           && this->it->TokenType == cmGeneratorExpressionToken::EndExpression)
         {
         --this->NestingLevel;
+        assert(this->it != this->Tokens.end());
         ++this->it;
         }
     }
@@ -185,6 +192,7 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
                                                          parameters.end();
       std::vector<TokenVector::const_iterator>::const_iterator commaIt =
                                                          commaTokens.begin();
+      assert(parameters.size() > commaTokens.size());
       for ( ; pit != pend; ++pit, ++commaIt)
         {
         extendResult(result, *pit);
@@ -232,6 +240,7 @@ void cmGeneratorExpressionParser::ParseContent(
           TextContent *textContent =
                               static_cast<TextContent*>(*(result.end() - 1));
           textContent->Extend(this->it->Length);
+          assert(this->it != this->Tokens.end());
           ++this->it;
           return;
           }
@@ -239,10 +248,12 @@ void cmGeneratorExpressionParser::ParseContent(
       cmGeneratorExpressionEvaluator* n = new TextContent(this->it->Content,
                                                           this->it->Length);
       result.push_back(n);
+      assert(this->it != this->Tokens.end());
       ++this->it;
       return ;
     }
     case cmGeneratorExpressionToken::BeginExpression:
+      assert(this->it != this->Tokens.end());
       ++this->it;
       this->ParseGeneratorExpression(result);
       return;
@@ -257,6 +268,7 @@ void cmGeneratorExpressionParser::ParseContent(
         {
           assert(!"Got unexpected syntax token.");
         }
+      assert(this->it != this->Tokens.end());
       ++this->it;
       return;
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=929956f6d085e1b2a05b3f1ae46cdd0db3347db9
commit 929956f6d085e1b2a05b3f1ae46cdd0db3347db9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Mon Oct 15 15:33:06 2012 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Mon Oct 15 15:35:26 2012 +0200

    Break if there are no more commas in the container
    
    This was causing an assert on Windows which has safety features for
    iterating past the end of the container.

diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx
index 341832a..64d992a 100644
--- a/Source/cmGeneratorExpressionParser.cxx
+++ b/Source/cmGeneratorExpressionParser.cxx
@@ -192,6 +192,10 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
           {
           extendText(result, *commaIt);
           }
+        else
+          {
+          break;
+          }
         }
       }
     return;

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGeneratorExpressionParser.cxx |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list