From 66c0b36d75e16d4b62022b498df06440a843fdd6 Mon Sep 17 00:00:00 2001 From: Pavel Solodovnikov Date: Wed, 20 Dec 2017 11:18:11 +0300 Subject: objlib: fix unchecked insertions in `cmGeneratorTarget::GetLanguages` --- Source/cmGeneratorTarget.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 103d034..2cf53cc 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -5133,7 +5133,12 @@ void cmGeneratorTarget::GetLanguages(std::set& languages, std::string objLib = extObj->GetObjectLibrary(); if (cmGeneratorTarget* tgt = this->LocalGenerator->FindGeneratorTargetToUse(objLib)) { - objectLibraries.push_back(tgt); + auto const objLibIt = + std::find_if(objectLibraries.cbegin(), objectLibraries.cend(), + [tgt](cmGeneratorTarget* t) { return t == tgt; }); + if (objectLibraries.cend() == objLibIt) { + objectLibraries.push_back(tgt); + } } } } -- cgit v0.12