Merge branch 'master' into merge-2.067

This commit is contained in:
David Nadlinger 2015-07-11 18:10:43 +02:00
commit 21d1bab114
6 changed files with 138 additions and 22 deletions

View file

@ -943,7 +943,11 @@ void DtoResolveVariable(VarDeclaration* vd)
Logger::println("parent: null");
}
const bool isLLConst = (vd->isConst() || vd->isImmutable()) && vd->init;
// If a const/immutable value has a proper initializer (not "= void"),
// it cannot be assigned again in a static constructor. Thus, we can
// emit it as read-only data.
const bool isLLConst = (vd->isConst() || vd->isImmutable()) &&
vd->init && !vd->init->isVoidInitializer();
assert(!vd->ir.isInitialized());
if (gIR->dmodule)