From 7081e939fb8aff7c1dbb6d2db1a1849d8ecb6eb6 Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Wed, 8 Oct 2025 03:02:31 +0530 Subject: [PATCH] Move _get_base_type to _get_base_type_and_depth --- pythonbpf/expr_pass.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pythonbpf/expr_pass.py b/pythonbpf/expr_pass.py index 3ba2125..fe04b68 100644 --- a/pythonbpf/expr_pass.py +++ b/pythonbpf/expr_pass.py @@ -129,12 +129,14 @@ def _handle_ctypes_call( return val -def _get_base_type(ir_type): +def _get_base_type_and_depth(ir_type): """Get the base type for pointer types.""" cur_type = ir_type + depth = 0 while isinstance(cur_type, ir.PointerType): + depth += 1 cur_type = cur_type.pointee - return cur_type + return cur_type, depth def _normalize_types(builder, lhs, rhs):