From: Nick Alcock Date: Wed, 29 Jan 2025 12:35:47 +0000 (+0000) Subject: libctf: make ctf_dynamic_type() the inverse of ctf_static_type() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=003f19bfa7f487ebe65823c899aed8a19a333a05;p=thirdparty%2Fbinutils-gdb.git libctf: make ctf_dynamic_type() the inverse of ctf_static_type() They're meant to be inverses, which makes it unfortunate that they check different bounds. No visible effect yet, since ctf_typemax and ctf_stypes currently cover the entire type ID space, but will have an effect shortly. --- diff --git a/libctf/ctf-create.c b/libctf/ctf-create.c index 7481e390f2e..5a131f2c205 100644 --- a/libctf/ctf-create.c +++ b/libctf/ctf-create.c @@ -287,8 +287,8 @@ ctf_dynamic_type (const ctf_dict_t *fp, ctf_id_t type) idx = LCTF_TYPE_TO_INDEX(fp, type); - if ((unsigned long) idx <= fp->ctf_typemax) - return ctf_dtd_lookup (fp, id); + if ((unsigned long) idx > fp->ctf_stypes) + return ctf_dtd_lookup (fp, type); return NULL; }