mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-01 23:50:43 +03: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:
parent
c1aeab8c07
commit
280be5ef8e
3 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue