From 003f19bfa7f487ebe65823c899aed8a19a333a05 Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Wed, 29 Jan 2025 12:35:47 +0000 Subject: [PATCH] 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. --- libctf/ctf-create.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.47.2