D2: Fixed global constants not initialized until module constructor.

This commit is contained in:
Tomas Lindquist Olsen
2008-11-12 05:40:31 +01:00
parent 5d9854aaff
commit d077bbc5e6
3 changed files with 61 additions and 12897 deletions

View File

@@ -964,6 +964,13 @@ void VarDeclaration::toObjFile(int multiobj)
{
Logger::println("data segment");
#if DMDV2
if (storage_class & STCmanifest)
{
assert(0 && "manifest constant being codegened!!!");
}
#endif
// don't duplicate work
if (this->ir.resolved) return;
this->ir.resolved = true;
@@ -975,7 +982,12 @@ void VarDeclaration::toObjFile(int multiobj)
// handle static local variables
bool static_local = false;
#if DMDV2
// not sure why this is only needed for d2
bool _isconst = isConst() && init;
#else
bool _isconst = isConst();
#endif
if (parent && parent->isFuncDeclaration())
{
static_local = true;

View File

@@ -1265,4 +1265,4 @@ void TypeInfoInvariantDeclaration::toDt(dt_t **pdt)
assert(0);
}
#endif
#endif

File diff suppressed because it is too large Load Diff