Commit 0a9a67cf authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixes: Possible crash when completing constructors.

parent 0d1624d4
...@@ -896,7 +896,10 @@ bool CppCodeCompletion::completeConstructors(Class *klass) ...@@ -896,7 +896,10 @@ bool CppCodeCompletion::completeConstructors(Class *klass)
for (unsigned i = 0; i < klass->memberCount(); ++i) { for (unsigned i = 0; i < klass->memberCount(); ++i) {
Symbol *member = klass->memberAt(i); Symbol *member = klass->memberAt(i);
if (! member->type()->isFunctionType()) FullySpecifiedType memberTy = member->type();
if (! memberTy)
continue;
else if (! memberTy->isFunctionType())
continue; continue;
else if (! member->identity()) else if (! member->identity())
continue; continue;
...@@ -930,8 +933,12 @@ bool CppCodeCompletion::completeQtMethod(CPlusPlus::FullySpecifiedType, ...@@ -930,8 +933,12 @@ bool CppCodeCompletion::completeQtMethod(CPlusPlus::FullySpecifiedType,
QSet<QString> signatures; QSet<QString> signatures;
foreach (TypeOfExpression::Result p, results) { foreach (TypeOfExpression::Result p, results) {
FullySpecifiedType ty = p.first; FullySpecifiedType ty = p.first;
if (! ty)
continue;
if (ReferenceType *refTy = ty->asReferenceType()) if (ReferenceType *refTy = ty->asReferenceType())
ty = refTy->elementType(); ty = refTy->elementType();
if (PointerType *ptrTy = ty->asPointerType()) if (PointerType *ptrTy = ty->asPointerType())
ty = ptrTy->elementType(); ty = ptrTy->elementType();
else else
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment