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.
This commit is contained in:
Tomas Lindquist Olsen 2009-02-03 23:48:47 +01:00
parent c1aeab8c07
commit 280be5ef8e
3 changed files with 4 additions and 2 deletions

View file

@ -290,7 +290,7 @@ LLConstant* DtoConstArrayInitializer(ArrayInitializer* arrinit)
// 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++)

View file

@ -1632,6 +1632,8 @@ DValue* NewExp::toElem(IRState* p)
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);

View file

@ -8,7 +8,7 @@ void foo()
hlt;
pass: ret;
}
version(X86_64)
else version(X86_64)
asm
{
naked;