[Cmake-commits] CMake branch, master, updated. v3.15.0-rc3-169-g56f5310

Kitware Robot kwrobot at kitware.com
Mon Jul 1 07:43:01 EDT 2019


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, master has been updated
       via  56f5310112705c00e0e1ae876cfde633c04bd740 (commit)
       via  822abf1265eacdffee37d3ed55e41425b6602e27 (commit)
      from  477a1ae478633a74c4dfe431a0c1e6b51194013b (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=56f5310112705c00e0e1ae876cfde633c04bd740
commit 56f5310112705c00e0e1ae876cfde633c04bd740
Merge: 477a1ae 822abf1
Author:     Craig Scott <craig.scott at crascit.com>
AuthorDate: Mon Jul 1 11:41:24 2019 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Mon Jul 1 07:42:04 2019 -0400

    Merge topic 'bug/19436'
    
    822abf1265 list(POP_FRONT): Fix always assigning first item to output vars
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !3497


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=822abf1265eacdffee37d3ed55e41425b6602e27
commit 822abf1265eacdffee37d3ed55e41425b6602e27
Author:     Alex Turbov <i.zaufi at gmail.com>
AuthorDate: Sun Jun 30 12:23:35 2019 +0300
Commit:     Alex Turbov <i.zaufi at gmail.com>
CommitDate: Sun Jun 30 13:15:29 2019 +0300

    list(POP_FRONT): Fix always assigning first item to output vars
    
    Fixes: #19436

diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 5474afa..1b01ea2 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -344,7 +344,7 @@ bool cmListCommand::HandlePopFrontCommand(std::vector<std::string> const& args)
       auto vi = varArgsExpanded.begin();
       for (; vi != varArgsExpanded.end() && ai != args.cend(); ++ai, ++vi) {
         assert(!ai->empty());
-        this->Makefile->AddDefinition(*ai, varArgsExpanded.front().c_str());
+        this->Makefile->AddDefinition(*ai, vi->c_str());
       }
       varArgsExpanded.erase(varArgsExpanded.begin(), vi);
       // Undefine the rest variables if the list gets empty earlier...
diff --git a/Tests/RunCMake/list/POP_FRONT.cmake b/Tests/RunCMake/list/POP_FRONT.cmake
index a2f8f3c..70f757a 100644
--- a/Tests/RunCMake/list/POP_FRONT.cmake
+++ b/Tests/RunCMake/list/POP_FRONT.cmake
@@ -77,3 +77,16 @@ endif()
 if(NOT test STREQUAL "two")
     message(FATAL_ERROR "`test` has unexpected value `${test}`")
 endif()
+
+# BUG 19436
+set(myList a b c)
+list(POP_FRONT myList first second)
+if(NOT first STREQUAL "a")
+    message(FATAL_ERROR "BUG#19436: `first` has unexpected value `${first}`")
+endif()
+if(NOT second STREQUAL "b")
+    message(FATAL_ERROR "BUG#19436: `second` has unexpected value `${second}`")
+endif()
+if(NOT myList STREQUAL "c")
+    message(FATAL_ERROR "BUG#19436: `myList` has unexpected value `${myList}`")
+endif()

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

Summary of changes:
 Source/cmListCommand.cxx            |  2 +-
 Tests/RunCMake/list/POP_FRONT.cmake | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list