We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 480afd1 commit 3f9604aCopy full SHA for 3f9604a
pythonbpf/expr_pass.py
@@ -139,6 +139,18 @@ def _get_base_type_and_depth(ir_type):
139
return cur_type, depth
140
141
142
+def _deref_to_depth(builder, val, target_depth):
143
+ """Dereference a pointer to a certain depth."""
144
+
145
+ cur_val = val
146
+ for _ in range(target_depth):
147
+ if not isinstance(val.type, ir.PointerType):
148
+ logger.error("Cannot dereference further, non-pointer type")
149
+ return None
150
+ cur_val = builder.load(cur_val)
151
+ return cur_val
152
153
154
def _normalize_types(builder, lhs, rhs):
155
"""Normalize types for comparison."""
156
0 commit comments