mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Add store_through_chain
This commit is contained in:
@ -43,6 +43,16 @@ def get_operand_value(operand, builder, local_sym_tab):
|
|||||||
raise TypeError(f"Unsupported operand type: {type(operand)}")
|
raise TypeError(f"Unsupported operand type: {type(operand)}")
|
||||||
|
|
||||||
|
|
||||||
|
def store_through_chain(value, chain, builder):
|
||||||
|
"""Store a value through a pointer chain."""
|
||||||
|
if not chain or len(chain) < 2:
|
||||||
|
raise ValueError("Pointer chain must have at least two elements")
|
||||||
|
|
||||||
|
for ptr in reversed(chain[1:]):
|
||||||
|
builder.store(value, ptr)
|
||||||
|
value = ptr
|
||||||
|
|
||||||
|
|
||||||
def handle_binary_op_impl(rval, builder, local_sym_tab):
|
def handle_binary_op_impl(rval, builder, local_sym_tab):
|
||||||
op = rval.op
|
op = rval.op
|
||||||
left, _, _ = get_operand_value(rval.left, builder, local_sym_tab)
|
left, _, _ = get_operand_value(rval.left, builder, local_sym_tab)
|
||||||
|
|||||||
Reference in New Issue
Block a user