瀏覽代碼

Avoid crash when checking property compatibility without link info

Teach the compatibility check added by commit 042ecf04 (Add API to
calculate link-interface-dependent bool properties or error, 2013-01-06)
to return early if no link information is available.  This avoids
crashing in a case that should fail with an error message.
Brad King 12 年之前
父節點
當前提交
ab079ee682
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      Source/cmTarget.cxx

+ 4 - 0
Source/cmTarget.cxx

@@ -4699,6 +4699,10 @@ PropertyType checkInterfacePropertyCompatibility(cmTarget *tgt,
       || (!impliedByUse && !explicitlySet));
 
   cmComputeLinkInformation *info = tgt->GetLinkInformation(config);
+  if(!info)
+    {
+    return propContent;
+    }
   const cmComputeLinkInformation::ItemVector &deps = info->GetItems();
   bool propInitialized = explicitlySet;