Commit 081e31fc authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Check for 0x0 pointers.

parent b9c56431
...@@ -1340,15 +1340,18 @@ protected: ...@@ -1340,15 +1340,18 @@ protected:
scope); scope);
foreach (LookupItem result, results) { foreach (LookupItem result, results) {
FullySpecifiedType fst = result.type(); FullySpecifiedType fst = result.type();
if (! result.declaration())
continue;
if (Enum *e = result.declaration()->type()->asEnumType()) if (Enum *e = result.declaration()->type()->asEnumType())
return e; return e;
if (NamedType *namedType = fst->asNamedType()) { if (NamedType *namedType = fst->asNamedType()) {
QList<LookupItem> candidates = QList<LookupItem> candidates =
typeOfExpression.context().lookup(namedType->name(), scope); typeOfExpression.context().lookup(namedType->name(), scope);
foreach (const LookupItem &r, candidates) { foreach (const LookupItem &r, candidates) {
Symbol *candidate = r.declaration(); if (Symbol *candidate = r.declaration()) {
if (Enum *e = candidate->asEnum()) { if (Enum *e = candidate->asEnum()) {
return e; return e;
}
} }
} }
} }
......
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