Fixed memory corruption bug caused by GC

This commit is contained in:
Hackerpilot 2014-05-12 15:30:22 -07:00
parent b105a0f6a2
commit 5df5716993
1 changed files with 3 additions and 1 deletions

View File

@ -3564,12 +3564,14 @@ invariant() foo();
m.scriptLine = advance();
if (currentIs(tok!"module"))
m.moduleDeclaration = parseModuleDeclaration();
Declaration[] declarations;
while (moreTokens())
{
auto declaration = parseDeclaration();
if (declaration !is null)
m.declarations ~= declaration;
declarations ~= declaration;
}
m.declarations = ownArray(declarations);
return m;
}