mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Fixed broken static struct member initializer
This commit is contained in:
committed by
David Nadlinger
parent
db9edaf053
commit
5ae17a59e4
@@ -271,8 +271,17 @@ std::vector<llvm::Value*> DtoStructLiteralValues(const StructDeclaration* sd,
|
||||
add_zeros(values, os - lastoffset - lastsize);
|
||||
}
|
||||
|
||||
// add the expression value
|
||||
values.push_back(inits[i]);
|
||||
size_t repCount = 1;
|
||||
// compute repCount to fill each array dimension
|
||||
for (Type *varType = var->type;
|
||||
varType->ty == Tsarray;
|
||||
varType = varType->nextOf())
|
||||
{
|
||||
repCount *= static_cast<TypeSArray*>(varType)->dim->toUInteger();
|
||||
}
|
||||
|
||||
// add the expression values
|
||||
std::fill_n(std::back_inserter(values), repCount, inits[i]);
|
||||
|
||||
// update offsets
|
||||
lastoffset = os;
|
||||
|
||||
Submodule tests/d2/dmd-testsuite updated: e3b121374e...1a32b14f56
Reference in New Issue
Block a user