Skip to content
Snippets Groups Projects
Commit a7cda431 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Fixed crash in lookup context due to null-name

Return early in this case.

Reviewed-by: Roberto Raggi
parent 9a5e1918
No related branches found
No related tags found
No related merge requests found
......@@ -159,8 +159,12 @@ bool LookupContext::maybeValidSymbol(Symbol *symbol,
QList<Symbol *> LookupContext::resolve(Name *name, const QList<Scope *> &visibleScopes,
ResolveMode mode) const
{
QList<Symbol *> candidates;
if (!name)
return candidates;
if (QualifiedNameId *q = name->asQualifiedNameId()) {
QList<Symbol *> candidates;
QList<Scope *> scopes = visibleScopes;
for (unsigned i = 0; i < q->nameCount(); ++i) {
Name *name = q->nameAt(i);
......@@ -210,7 +214,6 @@ QList<Symbol *> LookupContext::resolve(Name *name, const QList<Scope *> &visible
return candidates;
}
QList<Symbol *> candidates;
if (Identifier *id = identifier(name)) {
for (int scopeIndex = 0; scopeIndex < visibleScopes.size(); ++scopeIndex) {
Scope *scope = visibleScopes.at(scopeIndex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment