Skip to content

Commit

Permalink
Fix segfault with 'with' statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackerpilot committed Jan 18, 2015
1 parent a460bd1 commit 9ec503a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/conversion/first.d
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,17 @@ final class FirstPass : ASTVisitor
Scope* s = allocate!Scope(semanticAllocator,
withStatement.statementNoCaseNoDefault.startLocation,
withStatement.statementNoCaseNoDefault.endLocation);
SemanticSymbol* symbol = allocateSemanticSymbol(WITH_SYMBOL_NAME,
CompletionKind.withSymbol, symbolFile, s.startLocation, null);
s.parent = currentScope;
currentScope.children.insert(s);
populateInitializer(symbol, withStatement.expression, false);
currentScope = s;
SemanticSymbol* symbol = allocateSemanticSymbol(WITH_SYMBOL_NAME,
CompletionKind.withSymbol, symbolFile, s.startLocation, null);
symbol.parent = currentSymbol;
currentSymbol.addChild(symbol);
currentSymbol = symbol;
populateInitializer(symbol, withStatement.expression, false);
withStatement.accept(this);
currentSymbol = currentSymbol.parent;
currentSymbol.addChild(symbol);
currentScope = currentScope.parent;
}
else
Expand Down

0 comments on commit 9ec503a

Please sign in to comment.