From ec5505b8789b5afa12f0b4d04cd6bfc1767d4452 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Wed, 30 Jun 2004 12:57:17 +0000 Subject: [PATCH] allow to set negative values for type sizes [r3271] --- ir/tr/type.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ir/tr/type.c b/ir/tr/type.c index e36f9b7ed..c17a7d9bf 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -253,7 +253,8 @@ set_type_size_bits(type *tp, int size) { if (tp->type_op == type_primitive) tp->size = size; else { - tp->size = (size + 7) & ~7; + /* argh: we must allow to set negative values as "invalid size" */ + tp->size = (size >= 0) ? (size + 7) & ~7 : size; assert(tp->size == size && "setting a bit size is NOT allowed for this type"); } } -- 2.20.1