Skip to content

Commit ab71275

Browse files
committed
Add _get_base_type to expr_pass
1 parent 2d850f4 commit ab71275

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pythonbpf/expr_pass.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ def _handle_ctypes_call(
129129
return val
130130

131131

132+
def _get_base_type(ir_type):
133+
"""Get the base type for pointer types."""
134+
cur_type = ir_type
135+
while isinstance(cur_type, ir.PointerType):
136+
cur_type = cur_type.pointee
137+
return cur_type
138+
139+
132140
def _normalize_types(builder, lhs, rhs):
133141
"""Normalize types for comparison."""
134142

0 commit comments

Comments
 (0)