From: Alan Maguire <alan.maguire@oracle.com>
To: Florian Larysch <fl@n621.de>,
"dwarves@vger.kernel.org" <dwarves@vger.kernel.org>
Subject: Re: [PATCH] pahole: fix BTF function parameter type match check
Date: Thu, 16 Jul 2026 14:19:02 +0100 [thread overview]
Message-ID: <1246ee79-c064-4e93-babd-996b2d33dba2@oracle.com> (raw)
In-Reply-To: <20260714140858.17507-1-fl@n621.de>
On 14/07/2026 15:08, Florian Larysch wrote:
> The BTF_KIND_FUNC_PROTO arm in types__match() first checks whether two
> function types identified by t1/t2 have matching return types and then
> attempts to iterate over the function parameters (p1/p2) to check them
> for compatibility too.
>
> However, the loop just repeats the check on t1/t2 instead of p1/p2, so
> we just keep re-checking return type compatibility, ignoring possible
> mismatches of the actual parameter types.
>
> Fix this by actually comparing p1 and p2. This also resolves a
> unused-but-set-variable build-time warning.
>
> Signed-off-by: Florian Larysch <fl@n621.de>
Great catch, applied. Thank you!
Alan
> ---
> btf_encoder.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/btf_encoder.c b/btf_encoder.c
> index d5af706..3aca2c2 100644
> --- a/btf_encoder.c
> +++ b/btf_encoder.c
> @@ -1129,8 +1129,8 @@ static bool types__match(struct btf_encoder *encoder,
> btf2, t2->type))
> return false;
> for (i = 0; i < vlen; i++, p1++, p2++) {
> - if (!types__match(encoder, btf1, t1->type,
> - btf2, t2->type))
> + if (!types__match(encoder, btf1, p1->type,
> + btf2, p2->type))
> return false;
> }
> return true;
> --
> 2.55.0
>
prev parent reply other threads:[~2026-07-16 13:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-14 14:08 [PATCH] pahole: fix BTF function parameter type match check Florian Larysch
2026-07-16 13:19 ` Alan Maguire [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1246ee79-c064-4e93-babd-996b2d33dba2@oracle.com \
--to=alan.maguire@oracle.com \
--cc=dwarves@vger.kernel.org \
--cc=fl@n621.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox