From d7b1416ef2c46ee9b8bfe4e5ceb87b371d49504c Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Thu, 18 Mar 2021 12:37:52 +0000 Subject: libctf: types: unify code dealing with small-vs-large struct members This completes the job of unifying what was once three separate code paths full of duplication for every function dealing with querying the properties of struct and union members. The dynamic code path was already removed: this change removes the distinction between small and large members, by adding a helper that copies out members from the vlen, expanding small members into large ones as it does so. This makes it possible to have *more* representations of things like structure members without needing to change the querying functions at all. It also lets us check for buffer overruns more effectively, verifying that we don't accidentally overrun the end of the vlen in either the dynamic or static type case. libctf/ChangeLog 2021-03-18 Nick Alcock * ctf-impl.h (ctf_next_t) : New. : Remove. : Remove. : New. * ctf-types.c (ctf_struct_member): New. (ctf_member_next): Use it, dropping separate large/small code paths. (ctf_type_align): Likewise. (ctf_member_info): Likewise. (ctf_type_rvisit): Likewise. --- libctf/ChangeLog | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libctf/ChangeLog') diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 7874a77..85eb09d 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,5 +1,17 @@ 2021-03-18 Nick Alcock + * ctf-impl.h (ctf_next_t) : New. + : Remove. + : Remove. + : New. + * ctf-types.c (ctf_struct_member): New. + (ctf_member_next): Use it, dropping separate large/small code paths. + (ctf_type_align): Likewise. + (ctf_member_info): Likewise. + (ctf_type_rvisit): Likewise. + +2021-03-18 Nick Alcock + * ctf-impl.h (ctf_dtdef_t) : Remove. : Likewise. (ctf_dmdef_t): Remove. -- cgit v1.1