From 6fe356f275bf5487f408cb978548a845a6d99c5e Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Tue, 11 Dec 2007 08:45:59 +0000 Subject: [PATCH] Propagate type qualifiers in skip_typeref(). [r18668] --- type.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/type.c b/type.c index 8568ed6..ddfb8d0 100644 --- a/type.c +++ b/type.c @@ -689,7 +689,7 @@ bool pointers_compatible(const type_t *type1, const type_t *type2) type_t *skip_typeref(type_t *type) { - unsigned qualifiers = type->base.qualifiers; + unsigned qualifiers = TYPE_QUALIFIER_NONE; while(true) { switch(type->kind) { @@ -718,6 +718,16 @@ type_t *skip_typeref(type_t *type) break; } + if (qualifiers != TYPE_QUALIFIER_NONE) { + type_t *const copy = duplicate_type(type); + copy->base.qualifiers |= qualifiers; + + type = typehash_insert(copy); + if (type != copy) { + obstack_free(type_obst, copy); + } + } + return type; } -- 2.20.1