mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 00:23: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;
|
||||
|
||||
Reference in New Issue
Block a user