From 3cf7b6a95c3fc821a752c9212f55fa1439682790 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Sun, 26 Jul 2009 19:12:37 +0200 Subject: [PATCH] Fixed potential crash with complex recursive struct types. --- gen/llvmhelpers.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }