D6807: Fix segmentation fault caused by certain files

Kevin Funk noreply at phabricator.kde.org
Fri Jul 21 18:33:24 UTC 2017


kfunk requested changes to this revision.
kfunk added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> typebuilder.cpp:517
>                      static const QualifiedIdentifier currentQId(QStringLiteral("current"));
> -                    foreach (Declaration *d, classDec->internalContext()->findDeclarations(currentQId)) {
> -                        if (!dynamic_cast<ClassMethodDeclaration*>(d)) continue;
> -                        Q_ASSERT(d->type<FunctionType>());
> -                        injectType(d->type<FunctionType>()->returnType());
> -                        foundType = true;
> -                        // qCDebug(DUCHAIN) << "that's it: " << d->type<FunctionType>()->returnType()->toString();
> +                    if(classDec->internalContext() != nullptr) {
> +                        foreach (Declaration *d, classDec->internalContext()->findDeclarations(currentQId)) {

if (auto internalContext = classDec->internalContext()) {
       foreach (Declaration *d, internalContext->findDeclarations(currentQId)) {

REPOSITORY
  R52 KDevelop: PHP Support

REVISION DETAIL
  https://phabricator.kde.org/D6807

To: zhigalin, kfunk
Cc: kfunk, apol, kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170721/2ab63ca9/attachment-0001.html>


More information about the KDevelop-devel mailing list