D6807: Fix segmentation fault caused by certain files

Aleix Pol Gonzalez noreply at phabricator.kde.org
Fri Jul 21 13:46:09 UTC 2017


apol added a comment.


  Maybe you could add a unit test?

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 (classDec->internalContext())`
Note the space and that it's not really necessary to compare to nullptr.

REPOSITORY
  R52 KDevelop: PHP Support

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

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


More information about the KDevelop-devel mailing list