Mercurial > projects > ldc
diff gen/toobj.cpp @ 766:af04bbae8553
D2: Fixed global constants not initialized until module constructor.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 12 Nov 2008 05:40:31 +0100 |
parents | 9a9f403ab399 |
children | 340acf1535d0 |
line wrap: on
line diff
--- a/gen/toobj.cpp Wed Nov 12 07:41:56 2008 +0100 +++ b/gen/toobj.cpp Wed Nov 12 05:40:31 2008 +0100 @@ -964,6 +964,13 @@ { 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 @@ // 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;