summaryrefslogtreecommitdiffstats
path: root/cddl
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2014-11-16 04:10:23 +0000
committermarkj <markj@FreeBSD.org>2014-11-16 04:10:23 +0000
commite37e6f308b66649e54d5a5dce66e115059110639 (patch)
tree23e6227e475fd5cf2cb761bdbb7056724ab00439 /cddl
parentcf680a80e86f94a7c5c40aea2c8ffc1b8a5581b7 (diff)
downloadFreeBSD-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')
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/cvt/merge.c14
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;
OpenPOWER on IntegriCloud