Fixed crash when completing symbols without a valid context.

Task-number: QTCREATORBUG-534
Reviewed-by: Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>
This commit is contained in:
Roberto Raggi
2010-01-06 12:16:11 +01:00
committed by Thorbjørn Lindeijer
parent 738a950b75
commit 0fdb3bebee

View File

@@ -352,8 +352,10 @@ QList<Scope *> LookupContext::visibleScopes(const QPair<FullySpecifiedType, Symb
QList<Scope *> LookupContext::visibleScopes(Symbol *symbol) const
{
QList<Scope *> scopes;
for (Scope *scope = symbol->scope(); scope; scope = scope->enclosingScope())
scopes.append(scope);
if (symbol) {
for (Scope *scope = symbol->scope(); scope; scope = scope->enclosingScope())
scopes.append(scope);
}
scopes += visibleScopes();
scopes = expand(scopes);
return scopes;