diff options
author | markj <markj@FreeBSD.org> | 2014-11-16 04:10:23 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2014-11-16 04:10:23 +0000 |
commit | e37e6f308b66649e54d5a5dce66e115059110639 (patch) | |
tree | 23e6227e475fd5cf2cb761bdbb7056724ab00439 /cddl/contrib/opensolaris/tools/ctf | |
parent | cf680a80e86f94a7c5c40aea2c8ffc1b8a5581b7 (diff) | |
download | FreeBSD-src-e37e6f308b66649e54d5a5dce66e115059110639.zip FreeBSD-src-e37e6f308b66649e54d5a5dce66e115059110639.tar.gz |
Remove an incorrect optimization. The type IDs of each member of a struct or
union must be checked when determine whether two types are equivalent. This
bug could cause ctfmerge(1) to incorrectly merge distinct types.
Reviewed by: Robert Mustacchi <rm@joyent.com>
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'cddl/contrib/opensolaris/tools/ctf')
-rw-r--r-- | cddl/contrib/opensolaris/tools/ctf/cvt/merge.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c b/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c index 2ef37d4..27966af 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/merge.c @@ -287,19 +287,11 @@ equiv_su(tdesc_t *stdp, tdesc_t *ttdp, equiv_data_t *ed) while (ml1 && ml2) { if (ml1->ml_offset != ml2->ml_offset || - strcmp(ml1->ml_name, ml2->ml_name) != 0) + strcmp(ml1->ml_name, ml2->ml_name) != 0 || + ml1->ml_size != ml2->ml_size || + !equiv_node(ml1->ml_type, ml2->ml_type, ed)) return (0); - /* - * Don't do the recursive equivalency checking more than - * we have to. - */ - if (olm1 == NULL || olm1->ml_type->t_id != ml1->ml_type->t_id) { - if (ml1->ml_size != ml2->ml_size || - !equiv_node(ml1->ml_type, ml2->ml_type, ed)) - return (0); - } - olm1 = ml1; ml1 = ml1->ml_next; ml2 = ml2->ml_next; |