From 570dc10896979afa5d975986dbd8ec74a443577e Mon Sep 17 00:00:00 2001 From: Mikhail Solovev Date: Thu, 11 Sep 2025 18:52:41 +0300 Subject: [PATCH] aya-obj: fix variable length array index check --- aya-obj/src/btf/relocation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aya-obj/src/btf/relocation.rs b/aya-obj/src/btf/relocation.rs index 4b0b2fee..c90720f0 100644 --- a/aya-obj/src/btf/relocation.rs +++ b/aya-obj/src/btf/relocation.rs @@ -809,7 +809,7 @@ impl<'a> AccessSpec<'a> { let parent = accessors.last().unwrap(); let parent_ty = btf.type_by_id(parent.type_id)?; match parent_ty { - BtfType::Struct(s) => index == s.members.len() - 1, + BtfType::Struct(s) => parent.index == s.members.len() - 1, _ => false, } };