From e722fd74b4780ca189e8a8a9da8f7bca47ea02d2 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Wed, 22 Mar 2006 13:12:08 +0000 Subject: [PATCH] Bugged a fix [r7501] --- ir/tr/type.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ir/tr/type.c b/ir/tr/type.c index 9a933dc06..1cee8272e 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -361,7 +361,7 @@ int get_type_alignment_bits(ir_type *tp) { void set_type_alignment_bits(ir_type *tp, int align) { assert(tp && tp->kind == k_type); - assert((align & (align - 1)) == 0 && "type alignment not power of two"); + assert((align == -1 || (align & (align - 1)) == 0) && "type alignment not power of two"); /* Methods don't have an alignment. */ if (tp->type_op != type_method) { tp->align = align; @@ -370,7 +370,11 @@ set_type_alignment_bits(ir_type *tp, int align) { void set_type_alignment_bytes(ir_type *tp, int align) { - set_type_alignment_bits(tp, 8*align); + if (align == -1) { + set_type_alignment_bits(tp, -1); + } else { + set_type_alignment_bits(tp, 8*align); + } } /* Returns a human readable string for the enum entry. */ -- 2.20.1