mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-01 20:43:13 +01:00
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:
@@ -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++)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -8,7 +8,7 @@ void foo()
|
||||
hlt;
|
||||
pass: ret;
|
||||
}
|
||||
version(X86_64)
|
||||
else version(X86_64)
|
||||
asm
|
||||
{
|
||||
naked;
|
||||
|
||||
Reference in New Issue
Block a user