[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3193-g53ee3f6

Brad King brad.king at kitware.com
Wed Jul 17 11:22:34 EDT 2013


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  53ee3f6e18679a6477390e1acd94d2c52c122d1f (commit)
       via  17c841c42d69987c84940232428928c39f1637cd (commit)
      from  68d92176bcd7e8fd27a54a65b201129c144d7166 (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=53ee3f6e18679a6477390e1acd94d2c52c122d1f
commit 53ee3f6e18679a6477390e1acd94d2c52c122d1f
Merge: 68d9217 17c841c
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 17 11:22:32 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jul 17 11:22:32 2013 -0400

    Merge topic 'custom-command-assignment' into next
    
    17c841c add_custom_command: Manage backtrace memory correctly (#14299)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=17c841c42d69987c84940232428928c39f1637cd
commit 17c841c42d69987c84940232428928c39f1637cd
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 17 11:02:46 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jul 17 11:18:06 2013 -0400

    add_custom_command: Manage backtrace memory correctly (#14299)
    
    Add an assignment operator to cmCustomCommand to copy the Backtrace
    member pointee and avoid multiple-free on destruction.
    
    Reported-by: Vitezslav Cizek <vcizek at suse.cz>

diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index bd860ee..3620a38 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -13,6 +13,8 @@
 
 #include "cmMakefile.h"
 
+#include <cmsys/auto_ptr.hxx>
+
 //----------------------------------------------------------------------------
 cmCustomCommand::cmCustomCommand()
 {
@@ -36,6 +38,32 @@ cmCustomCommand::cmCustomCommand(const cmCustomCommand& r):
 }
 
 //----------------------------------------------------------------------------
+cmCustomCommand& cmCustomCommand::operator=(cmCustomCommand const& r)
+{
+  if(this == &r)
+    {
+    return *this;
+    }
+
+  this->Outputs = r.Outputs;
+  this->Depends = r.Depends;
+  this->CommandLines = r.CommandLines;
+  this->HaveComment = r.HaveComment;
+  this->Comment = r.Comment;
+  this->WorkingDirectory = r.WorkingDirectory;
+  this->EscapeAllowMakeVars = r.EscapeAllowMakeVars;
+  this->EscapeOldStyle = r.EscapeOldStyle;
+  this->ImplicitDepends = r.ImplicitDepends;
+
+  cmsys::auto_ptr<cmListFileBacktrace>
+    newBacktrace(new cmListFileBacktrace(*r.Backtrace));
+  delete this->Backtrace;
+  this->Backtrace = newBacktrace.release();
+
+  return *this;
+}
+
+//----------------------------------------------------------------------------
 cmCustomCommand::cmCustomCommand(cmMakefile* mf,
                                  const std::vector<std::string>& outputs,
                                  const std::vector<std::string>& depends,
diff --git a/Source/cmCustomCommand.h b/Source/cmCustomCommand.h
index dd92e34..e20d2bf 100644
--- a/Source/cmCustomCommand.h
+++ b/Source/cmCustomCommand.h
@@ -27,6 +27,7 @@ public:
   /** Default and copy constructors for STL containers.  */
   cmCustomCommand();
   cmCustomCommand(const cmCustomCommand& r);
+  cmCustomCommand& operator=(cmCustomCommand const& r);
 
   /** Main constructor specifies all information for the command.  */
   cmCustomCommand(cmMakefile* mf,

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

Summary of changes:
 Source/cmCustomCommand.cxx |   28 ++++++++++++++++++++++++++++
 Source/cmCustomCommand.h   |    1 +
 2 files changed, 29 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list