changeset 1550:c704fea92f80

Fixed potential crash with complex recursive struct types.
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Sun, 26 Jul 2009 19:12:37 +0200
parents 327eef051d50
children ed0feda76820
files gen/llvmhelpers.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp	Sun Jul 26 18:32:25 2009 +0200
+++ b/gen/llvmhelpers.cpp	Sun Jul 26 19:12:37 2009 +0200
@@ -1458,8 +1458,9 @@
 
     // 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<llvm::OpaqueType>(T))
+    if (!T->isSized())
     {
         return offset;
     }