Index: gdbtypes.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtypes.c,v retrieving revision 1.115 diff -u -p -r1.115 gdbtypes.c --- gdbtypes.c 17 May 2007 16:38:25 -0000 1.115 +++ gdbtypes.c 17 May 2007 16:40:53 -0000 @@ -354,6 +354,7 @@ make_reference_type (struct type *type, { struct type *ntype; /* New type */ struct objfile *objfile; + struct type *chain; ntype = TYPE_REFERENCE_TYPE (type); @@ -379,7 +380,9 @@ make_reference_type (struct type *type, { ntype = *typeptr; objfile = TYPE_OBJFILE (ntype); + chain = TYPE_CHAIN (ntype); smash_type (ntype); + TYPE_CHAIN (ntype) = chain; TYPE_OBJFILE (ntype) = objfile; } @@ -395,6 +398,14 @@ make_reference_type (struct type *type, if (!TYPE_REFERENCE_TYPE (type)) /* Remember it, if don't have one. */ TYPE_REFERENCE_TYPE (type) = ntype; + /* Update the length of all the other variants of this type. */ + chain = TYPE_CHAIN (ntype); + while (chain != ntype) + { + TYPE_LENGTH (chain) = TYPE_LENGTH (ntype); + chain = TYPE_CHAIN (chain); + } + return ntype; }