forked from qt-creator/qt-creator
Fixes: Possible crash when completing constructors.
This commit is contained in:
@@ -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,
|
|||||||
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
|
||||||
|
Reference in New Issue
Block a user