From 316c21c42865f4853c507da14083a4f29d073086 Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Tue, 11 Nov 2025 21:00:42 +0530 Subject: [PATCH] Fix char_array to pointer/int detection fallback in helper_utils --- pythonbpf/helper/helper_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pythonbpf/helper/helper_utils.py b/pythonbpf/helper/helper_utils.py index 06d3cf1..d9cb7cd 100644 --- a/pythonbpf/helper/helper_utils.py +++ b/pythonbpf/helper/helper_utils.py @@ -287,7 +287,8 @@ def get_char_array_ptr_and_size(buf_arg, builder, local_sym_tab, struct_sym_tab) field_type = struct_info.field_type(field_name) if not _is_char_array(field_type): - raise ValueError("Expected char array field") + logger.info("Field is not a char array, falling back to int or ptr detection") + return None, 0 struct_ptr = local_sym_tab[var_name].var field_ptr = struct_info.gep(builder, struct_ptr, field_name)