libctf: create: ctf_add_type should hand back already-added non-SoUs
authorNick Alcock <nick.alcock@oracle.com>
Tue, 5 Nov 2019 13:09:57 +0000 (13:09 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 26 Jun 2020 14:56:39 +0000 (15:56 +0100)
commitd04a47ac53b7e3ae572021711c91f2f3d333417b
tree90f3e7110f3d343e5bf07c249e973efebc183ab9
parent6bbf9da8927e848d3d6fdd188ca84385f1dddcce
libctf: create: ctf_add_type should hand back already-added non-SoUs

When we add a type from a dictionary and then try to add it again, we
should hand it back unchanged unless it is a structure, union or enum
with a different number of members.  That's what the comment says we do.

Instead, we hand it back unchanged *only* if it is a structure, union or
enum with the same number of members: non-structs, unions and enums are
unconditionally added.  This causes extreme type bloating and (in
conjunction with the bug fixed by the next commit) can easily lead to
the same type being mistakenly added to a dictionary more than once
(which, for forwards, was not banned and led to dictionary corruption).

libctf/
* ctf-create.c (ctf_add_type_internal): Hand back existing types
unchanged.
libctf/ChangeLog
libctf/ctf-create.c
This page took 0.023098 seconds and 4 git commands to generate.