mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-19 21:23:22 +01:00
[svn r29] * Fixed structs inside struct literals
This commit is contained in:
@@ -1378,7 +1378,12 @@ elem* StructLiteralExp::toElem(IRState* p)
|
||||
elem* ve = vx->toElem(p);
|
||||
llvm::Value* val = ve->getValue();
|
||||
Logger::cout() << *val << " | " << *arrptr << '\n';
|
||||
new llvm::StoreInst(val, arrptr, p->scopebb());
|
||||
if (vx->type->ty == Tstruct) {
|
||||
TypeStruct* ts = (TypeStruct*)vx->type;
|
||||
LLVM_DtoStructCopy(ts,arrptr,val);
|
||||
}
|
||||
else
|
||||
new llvm::StoreInst(val, arrptr, p->scopebb());
|
||||
delete ve;
|
||||
}
|
||||
else {
|
||||
|
||||
23
test/structs5.d
Normal file
23
test/structs5.d
Normal file
@@ -0,0 +1,23 @@
|
||||
module structs5;
|
||||
|
||||
void main()
|
||||
{
|
||||
{S s = S();}
|
||||
{T t = T(1);}
|
||||
{U u = U();}
|
||||
}
|
||||
|
||||
struct S
|
||||
{
|
||||
}
|
||||
|
||||
struct T
|
||||
{
|
||||
int i;
|
||||
}
|
||||
|
||||
struct U
|
||||
{
|
||||
S s;
|
||||
long l;
|
||||
}
|
||||
Reference in New Issue
Block a user