Fix segfault
This commit is contained in:
parent
ae46655c54
commit
64503a6801
|
|
@ -416,6 +416,8 @@ ACSymbol*[] getSymbolsByTokenChain(T)(Scope* completionScope,
|
||||||
// tokens.map!stringToken);
|
// tokens.map!stringToken);
|
||||||
// Find the symbol corresponding to the beginning of the chain
|
// Find the symbol corresponding to the beginning of the chain
|
||||||
ACSymbol*[] symbols;
|
ACSymbol*[] symbols;
|
||||||
|
if (tokens.length == 0)
|
||||||
|
return [];
|
||||||
if (tokens[0] == tok!"." && tokens.length > 1)
|
if (tokens[0] == tok!"." && tokens.length > 1)
|
||||||
{
|
{
|
||||||
tokens = tokens[1 .. $];
|
tokens = tokens[1 .. $];
|
||||||
|
|
|
||||||
|
|
@ -435,6 +435,7 @@ final class FirstPass : ASTVisitor
|
||||||
Scope* s = allocate!Scope(semanticAllocator, feStatement.startIndex, bs.endLocation);
|
Scope* s = allocate!Scope(semanticAllocator, feStatement.startIndex, bs.endLocation);
|
||||||
s.parent = currentScope;
|
s.parent = currentScope;
|
||||||
currentScope.children.insert(s);
|
currentScope.children.insert(s);
|
||||||
|
currentScope = s;
|
||||||
feExpression = feStatement.low.items[$ - 1];
|
feExpression = feStatement.low.items[$ - 1];
|
||||||
feStatement.accept(this);
|
feStatement.accept(this);
|
||||||
feExpression = null;
|
feExpression = null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue