From 6522e38f03a92510c47b7d690a284545086f1f55 Mon Sep 17 00:00:00 2001 From: Andreas Zwinkau Date: Wed, 20 Apr 2011 13:33:06 +0200 Subject: [PATCH] Handle chains of lowerings correctly --- ir/tr/type.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ir/tr/type.c b/ir/tr/type.c index 85d96e08a..6d4f52fc7 100644 --- a/ir/tr/type.c +++ b/ir/tr/type.c @@ -2100,6 +2100,10 @@ void set_lowered_type(ir_type *tp, ir_type *lowered_type) { assert(is_type(tp) && is_type(lowered_type)); lowered_type->flags |= tf_lowered_type; + /* there might be a chain of lowerings, get to the start */ + while (is_lowered_type(tp)) { + tp = tp->assoc_type; + } tp->assoc_type = lowered_type; lowered_type->assoc_type = tp; } -- 2.20.1