diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ir/ty.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ir/ty.rs b/src/ir/ty.rs index f54d4760..625b5f87 100644 --- a/src/ir/ty.rs +++ b/src/ir/ty.rs @@ -249,6 +249,12 @@ impl Type { self.layout.or_else(|| { match self.kind { TypeKind::Comp(ref ci) => ci.layout(ctx), + TypeKind::Array(inner, length) if length == 0 => { + Some(Layout::new( + 0, + ctx.resolve_type(inner).layout(ctx)?.align, + )) + } // FIXME(emilio): This is a hack for anonymous union templates. // Use the actual pointer size! TypeKind::Pointer(..) => { |