Project

General

Profile

Bug #5354

ctfmerge struct/union equivalence needs to check member types

Added by Robert Mustacchi over 4 years ago.

Status:
New
Priority:
Normal
Category:
tools - gate/build tools
Start date:
2014-11-16
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

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.

Consider

  struct a { int x, int y };

  struct b {int x, unsigned int y };

In this case, the code wasn't comparing the types of the "y" members,
since "x" and "y" have the same type in struct a. I'm not really sure
what optimization was being attempted there, but the code that's present
is wrong.

Also available in: Atom PDF