[cmake-developers] [PATCH] Fix crash in cmExportInstallFileGenerator::FindNamespaces()

2016-01-20 Thread Andrey Pokrovskiy
>From 0852339e3ab545af709246c8e767e996cb629707 Mon Sep 17 00:00:00 2001
From: wonder-mice 
Date: Wed, 20 Jan 2016 18:29:58 -0800
Subject: [PATCH] Fix crash in cmExportInstallFileGenerator::FindNamespaces()

Found it when was building poco library:
https://github.com/pocoproject/poco.git

Steps to reproduce:
1. Clone poco
2. mkdir poco.git/build.make
3. cd poco.git/build.make
4. cmake ..
5. Crash

As I understand this place was missed during refactoring performed in
this commit:

commit 381e7afd363d64c72b83e69fd6c6cad5fc3eefb4
Author: Stephen Kelly 
Date:   Sat Oct 17 13:31:33 2015 +0200

cmExportSet: Store a cmGeneratorTarget.

Set the member at compute time from the stored name.
---
 Source/cmExportInstallFileGenerator.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Source/cmExportInstallFileGenerator.cxx
b/Source/cmExportInstallFileGenerator.cxx
index b695904..71418e8 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -496,7 +496,7 @@ cmExportInstallFileGenerator
 bool containsTarget = false;
 for(unsigned int i=0; isize(); i++)
   {
-  if (name == (*targets)[i]->Target->GetName())
+  if (name == (*targets)[i]->TargetName)
 {
 containsTarget = true;
 break;
-- 
2.5.4 (Apple Git-61)


0001-Fix-crash-in-cmExportInstallFileGenerator-FindNamesp.patch
Description: Binary data
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] [PATCH] Fix crash in cmExportInstallFileGenerator::FindNamespaces()

2016-01-21 Thread Brad King
On 01/20/2016 09:41 PM, Andrey Pokrovskiy wrote:
> Subject: [PATCH] Fix crash in cmExportInstallFileGenerator::FindNamespaces()
> 
> Found it when was building poco library:
> https://github.com/pocoproject/poco.git
> 
> Steps to reproduce:
> 1. Clone poco
> 2. mkdir poco.git/build.make
> 3. cd poco.git/build.make
> 4. cmake ..
> 5. Crash

Thanks.  From that I was able to produce a simpler test case
which I've added to the commit message.  Applied:

 cmExportInstallFileGenerator: Fix crash in FindNamespaces
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7dbfdddf

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers