Skip to content

Commit 9becee8

Browse files
add expected type check
1 parent 189526d commit 9becee8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pythonbpf/assign_pass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def handle_variable_assignment(
181181
expected_ptr_type = ir.PointerType(struct_info.ir_type)
182182

183183
# Check if var_type matches the expected pointer type
184-
if isinstance(var_type, ir.PointerType):
184+
if isinstance(var_type, ir.PointerType) and var_type == expected_ptr_type:
185185
# val is already the correct pointer type from inttoptr/bitcast
186186
builder.store(val, var_ptr)
187187
logger.info(f"Assigned user-defined struct pointer cast to {var_name}")

0 commit comments

Comments
 (0)