Skip to content

Commit 480afd1

Browse files
committed
Move _get_base_type to _get_base_type_and_depth
1 parent ab71275 commit 480afd1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pythonbpf/expr_pass.py

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

131131

132-
def _get_base_type(ir_type):
132+
def _get_base_type_and_depth(ir_type):
133133
"""Get the base type for pointer types."""
134134
cur_type = ir_type
135+
depth = 0
135136
while isinstance(cur_type, ir.PointerType):
137+
depth += 1
136138
cur_type = cur_type.pointee
137-
return cur_type
139+
return cur_type, depth
138140

139141

140142
def _normalize_types(builder, lhs, rhs):

0 commit comments

Comments
 (0)