diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index c0d73121..6c6730d8 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -1458,8 +1458,9 @@ size_t realignOffset(size_t offset, Type* type) // we cannot get the llvm alignment if the type is still opaque, this can happen in some // forward reference situations, so when this happens we fall back to manual padding. + // also handle arbitrary "by-value" opaques nested inside aggregates. const llvm::Type* T = DtoType(type); - if (llvm::isa(T)) + if (!T->isSized()) { return offset; }