From: Christoph Mallon Date: Tue, 11 Dec 2007 08:45:59 +0000 (+0000) Subject: Propagate type qualifiers in skip_typeref(). X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=6fe356f275bf5487f408cb978548a845a6d99c5e;p=cparser Propagate type qualifiers in skip_typeref(). [r18668] --- 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; }