Fix segfault

This commit is contained in:
Hackerpilot 2014-08-12 12:32:44 -07:00
parent ae46655c54
commit 64503a6801
2 changed files with 3 additions and 0 deletions

View File

@ -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 .. $];

View File

@ -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;