mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-16 21:03:14 +01:00
Fixed initialization of a struct with an array from another struct
This commit is contained in:
@@ -280,6 +280,13 @@ std::vector<llvm::Value*> DtoStructLiteralValues(const StructDeclaration* sd, co
|
||||
|
||||
// update offsets
|
||||
lastoffset = os;
|
||||
#if DMDV2
|
||||
// sometimes size of the initializer is less than size of the variable,
|
||||
// so make sure that lastsize is correct
|
||||
if (inits[i]->getType()->isSized())
|
||||
lastsize = ceil(gTargetData->getTypeSizeInBits(inits[i]->getType()) / 8.0);
|
||||
else
|
||||
#endif
|
||||
lastsize = sz;
|
||||
|
||||
// go to next explicit init
|
||||
|
||||
Reference in New Issue
Block a user