[05/17] ctf-reader: Do not set data member offsets for unions
Commit Message
From: Dodji Seketeli <dodji@redhat.com>
All union data members should have an offset set to 0. It turns out
the CTF reader unnecessarily sets the data member offset. This patch
fixes that.
* src/abg-ctf-reader.cc (process_ctf_sou_members): Do not set any
union data member offset.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
src/abg-ctf-reader.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -1087,7 +1087,7 @@ process_ctf_sou_members(reader *rdr,
public_access,
true /* is_laid_out */,
false /* is_static */,
- membinfo.ctm_offset);
+ is_union_type(sou) ? 0 : membinfo.ctm_offset);
}
if (ctf_errno(ctf_dictionary) != ECTF_NEXT_END)
fprintf(stderr, "ERROR from ctf_member_next\n");