mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-28 10:33:14 +01:00
D2: Fixed global constants not initialized until module constructor.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -1265,4 +1265,4 @@ void TypeInfoInvariantDeclaration::toDt(dt_t **pdt)
|
||||
assert(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
12944
runtime/ldc2.diff
12944
runtime/ldc2.diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user