From ab7127556605c59a31d3ea3faea9811adff57ce8 Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Wed, 8 Oct 2025 03:00:52 +0530 Subject: [PATCH] Add _get_base_type to expr_pass --- pythonbpf/expr_pass.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pythonbpf/expr_pass.py b/pythonbpf/expr_pass.py index fa22c2e..3ba2125 100644 --- a/pythonbpf/expr_pass.py +++ b/pythonbpf/expr_pass.py @@ -129,6 +129,14 @@ def _handle_ctypes_call( return val +def _get_base_type(ir_type): + """Get the base type for pointer types.""" + cur_type = ir_type + while isinstance(cur_type, ir.PointerType): + cur_type = cur_type.pointee + return cur_type + + def _normalize_types(builder, lhs, rhs): """Normalize types for comparison."""