Hello community, here is the log from the commit of package kdevelop4 for openSUSE:Factory checked in at 2016-06-26 23:52:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kdevelop4 (Old) and /work/SRC/openSUSE:Factory/.kdevelop4.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kdevelop4" Changes: -------- --- /work/SRC/openSUSE:Factory/kdevelop4/kdevelop4.changes 2016-05-16 12:04:28.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.kdevelop4.new/kdevelop4.changes 2016-06-26 23:52:15.000000000 +0200 @@ -1,0 +2,6 @@ +Thu Jun 23 16:21:37 UTC 2016 - buschman...@opensuse.org + +- add fix-for-null-pointer-dereference-with-gcc6.patch to fix bug + kde#360707 on openSUSE Tumbleweed / GCC6 + +------------------------------------------------------------------- New: ---- fix-for-null-pointer-dereference-with-gcc6.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdevelop4.spec ++++++ --- /var/tmp/diff_new_pack.QBId8h/_old 2016-06-26 23:52:17.000000000 +0200 +++ /var/tmp/diff_new_pack.QBId8h/_new 2016-06-26 23:52:17.000000000 +0200 @@ -25,6 +25,8 @@ Url: http://www.kdevelop.org Source0: http://download.kde.org/stable/kdevelop/%{version}/src/kdevelop-%{version}.tar.bz2 Source1: missing-translations.tar.xz +# PATCH-FIX-UPSTREAM fix-for-null-pointer-dereference-with-gcc6.patch kde#360707 +Patch1: fix-for-null-pointer-dereference-with-gcc6.patch BuildRequires: fdupes # SLE12 doesn't have kdebase4-workspace[-devel] %if 0%{?suse_version} != 1315 || 0%{?is_opensuse} @@ -97,6 +99,9 @@ %lang_package %prep %setup -q -n kdevelop-%{version} +%if 0%{?suse_version} > 1320 +%patch1 -p1 +%endif %if 0%{?suse_version} <= 1320 && !0%{?is_opensuse} # fix build with older cmake versions (i.e. on 13.2 and below) by # readding "cmake_policy(SET CMP0002 OLD)" to po/CMakeLists.txt ++++++ fix-for-null-pointer-dereference-with-gcc6.patch ++++++ From: Kevin Funk <kf...@kde.org> Date: Mon, 21 Mar 2016 23:39:02 +0000 Subject: Fix places with undefined behavior References: kde#360707 Upstream: submitted New API: IndexedType::IndexedType(const AbstractType::Ptr& type) Places where we may call AbstractPtr::indexed with this being a nullptr. Similar patches probably need to be applied to other language plugins CCMAIL: kdevelop-de...@kde.org CCBUG: 360707 --- --- a/languages/cpp/cppduchain/cppducontext.h +++ b/languages/cpp/cppduchain/cppducontext.h @@ -340,7 +340,9 @@ DelayedType::Ptr delayed( new DelayedType() ); delayed->setIdentifier( i ); - res.type = Cpp::resolveDelayedTypes( delayed.cast<AbstractType>(), this, source, basicFlags & KDevelop::DUContext::NoUndefinedTemplateParams ? DUContext::NoUndefinedTemplateParams : DUContext::NoSearchFlags )->indexed(); + auto resolved = Cpp::resolveDelayedTypes( delayed.cast<AbstractType>(), this, + source, basicFlags & DUContext::NoUndefinedTemplateParams ? DUContext::NoUndefinedTemplateParams : DUContext::NoSearchFlags ); + res.type = IndexedType(resolved); if( basicFlags & KDevelop::DUContext::NoUndefinedTemplateParams) { AbstractType::Ptr targetTypePtr = TypeUtils::unAliasedType(TypeUtils::targetType(res.type.abstractType(), 0)); --- a/languages/cpp/cppduchain/declarationbuilder.cpp +++ b/languages/cpp/cppduchain/declarationbuilder.cpp @@ -371,10 +371,10 @@ foreach (Declaration* dec, declarations) { if (dec->isForwardDeclaration() || dec->isDefinition()) continue; - if (dec->abstractType()->indexed() == lastType()->indexed()) { + if (IndexedType(dec->abstractType()) == IndexedType(lastType())) { //If this declaration is already assigned to a partial match, unassign it if (FunctionDefinition* oldDef = FunctionDefinition::definition(dec)) { - if (oldDef->abstractType()->indexed() != dec->abstractType()->indexed()) + if (IndexedType(oldDef->abstractType()) != IndexedType(dec->abstractType())) oldDef->setDeclaration(0); } funDef->setDeclaration(dec); @@ -1173,7 +1173,7 @@ instance.virtualInheritance = (bool)node->virt; //TypeUtils::unAliasedType( - instance.baseClass = TypeUtils::unAliasedType(lastType())->indexed(); + instance.baseClass = IndexedType(TypeUtils::unAliasedType(lastType())); if(currentClass->classType() == ClassDeclarationData::Struct) instance.access = KDevelop::Declaration::Public; else --- a/languages/cpp/cppduchain/expressionparser.cpp +++ b/languages/cpp/cppduchain/expressionparser.cpp @@ -204,7 +204,7 @@ DUChainReadLocker lock(DUChain::lock()); - ret.type = v.lastType()->indexed(); + ret.type = v.lastType() ? v.lastType()->indexed() : IndexedType(); ret.isInstance = v.lastInstance().isInstance; if(v.lastInstance().declaration) --- a/languages/cpp/cppduchain/name_visitor.cpp +++ b/languages/cpp/cppduchain/name_visitor.cpp @@ -166,7 +166,7 @@ if( m_visitor->lastType() ) { LOCKDUCHAIN; - res.type = m_visitor->lastType()->indexed(); + res.type = IndexedType(m_visitor->lastType()); foreach(const DeclarationPointer &decl, m_visitor->lastDeclarations()) if(decl) res.allDeclarationsList().append(decl->id()); @@ -197,7 +197,7 @@ return ExpressionEvaluationResult(); } - res.type = v.type()->indexed(); + res.type = IndexedType(v.type()); if( res.type ) { LOCKDUCHAIN; --- a/languages/cpp/cppduchain/templatedeclaration.cpp +++ b/languages/cpp/cppduchain/templatedeclaration.cpp @@ -924,7 +924,7 @@ Q_ASSERT(!templateDecl->defaultParameter().isEmpty()); DelayedType::Ptr delayed( new DelayedType() ); delayed->setIdentifier( IndexedTypeIdentifier(templateDecl->defaultParameter()) ); - type = resolveDelayedTypes( delayed.cast<AbstractType>(), surroundingContext, source)->indexed(); + type = IndexedType(resolveDelayedTypes(delayed.cast<AbstractType>(), surroundingContext, source)); } // else the parameter is missing //TODO: why is this neccessary? @@ -1049,7 +1049,7 @@ UnAliasExchanger exchanger(source); for(uint a = 0; a < templateArguments.templateParametersSize(); ++a) - newTemplateArguments.templateParametersList().append(exchanger.exchange(templateArguments.templateParameters()[a].abstractType())->indexed()); + newTemplateArguments.templateParametersList().append(IndexedType(exchanger.exchange(templateArguments.templateParameters()[a].abstractType()))); templateArguments = newTemplateArguments; } --- a/languages/cpp/cppduchain/typeconversion.cpp +++ b/languages/cpp/cppduchain/typeconversion.cpp @@ -206,7 +206,7 @@ if( realTo->modifiers() & AbstractType::ConstModifier ) { //For constant references, the compiler can create a temporary object holding the converted value. So just forget whether the types are references. - conv = implicitConversion( realType(from, m_topContext)->indexed(), realType(to, m_topContext)->indexed(), fromLValue, noUserDefinedConversion ); + conv = implicitConversion( IndexedType(realType(from, m_topContext)), IndexedType(realType(to, m_topContext)), fromLValue, noUserDefinedConversion ); goto ready; } } @@ -361,7 +361,7 @@ if( isReferenceType(from) ) { ///Transform lvalue to rvalue. Iso c++ draft 4.1 modeled roughly - AbstractType::Ptr fromNonConstant = realType(from, m_topContext)->indexed().abstractType(); + AbstractType::Ptr fromNonConstant = IndexedType(realType(from, m_topContext)).abstractType(); //When copying, the type becomes non-constant if(fromNonConstant && fromNonConstant->modifiers() & AbstractType::ConstModifier) @@ -388,7 +388,7 @@ maximizeRank( bestRank, worseRank(rank, ExactMatch ) ); }else if(from->modifiers() & AbstractType::ConstModifier) { ///We can transform a constant lvalue to a non-constant rvalue - AbstractType::Ptr fromNonConstant = from->indexed().abstractType(); + AbstractType::Ptr fromNonConstant = IndexedType(from).abstractType(); fromNonConstant->setModifiers(fromNonConstant->modifiers() & ~(AbstractType::ConstModifier)); ConversionRank ret = standardConversion( fromNonConstant, to, removeCategories(categories,LValueTransformationCategory), maxCategories-1 ); maximizeRank( bestRank, ret ); --- a/languages/cpp/cppduchain/typeutils.cpp +++ b/languages/cpp/cppduchain/typeutils.cpp @@ -234,7 +234,7 @@ foreach(Declaration* decl, internal->findDeclarations(Cpp::castIdentifier().identifier(), CursorInRevision::invalid(), topContext, (DUContext::SearchFlags)(DUContext::DontSearchInParent | DUContext::NoFiltering))) { FunctionType::Ptr funType = decl->type<FunctionType>(); if(funType && funType->returnType()) { - if(conversion.implicitConversion(funType->returnType()->indexed(), matchTo->indexed(), true)) { + if(conversion.implicitConversion(IndexedType(funType->returnType()), IndexedType(matchTo), true)) { return funType->returnType(); } } @@ -292,7 +292,7 @@ { AbstractType::Ptr type = indexedType.abstractType(); removeConstModifier(type); - return type->indexed(); + return IndexedType(type); } void removeConstModifier(AbstractType::Ptr& type)