Mercurial > projects > ldc
changeset 932:5e3bb0c3ea8b
Fixed dstress/run/a/array_initialization_17_A.d regression. default initialized static array elements in a constant static array initializer was getting incorrect values.
Fixed minor version problem in mini/naked_asm4.d test case.
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Tue, 03 Feb 2009 23:48:47 +0100 |
parents | b6647328d11e |
children | d3a6f1a96731 |
files | gen/arrays.cpp gen/toir.cpp tests/mini/naked_asm4.d |
diffstat | 3 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/gen/arrays.cpp Tue Feb 03 21:46:54 2009 +0100 +++ b/gen/arrays.cpp Tue Feb 03 23:48:47 2009 +0100 @@ -290,7 +290,7 @@ // fill out any null entries still left with default values // element default initializer - LLConstant* defelem = elemty->defaultInit(arrinit->loc)->toConstElem(gIR); + LLConstant* defelem = DtoConstExpInit(arrinit->loc, elemty, elemty->defaultInit(arrinit->loc)); bool mismatch2 = (defelem->getType() != llelemty); for (size_t i = 0; i < arrlen; i++)
--- a/gen/toir.cpp Tue Feb 03 21:46:54 2009 +0100 +++ b/gen/toir.cpp Tue Feb 03 23:48:47 2009 +0100 @@ -1632,6 +1632,8 @@ DVarValue tmpvar(newtype, mem); // default initialize + // FIXME: should this use DtoConstExpInit instead ? + // or is static arrays the only troublemaker? Expression* exp = newtype->defaultInit(loc); DValue* iv = exp->toElem(gIR); DtoAssign(loc, &tmpvar, iv);