add alloc for only i64

This commit is contained in:
2025-10-24 02:06:39 +05:30
parent 36a1a0903e
commit 64674cf646
7 changed files with 79 additions and 20 deletions

View File

@ -20,7 +20,7 @@ from pythonbpf.assign_pass import (
from pythonbpf.allocation_pass import (
handle_assign_allocation,
allocate_temp_pool,
create_targets_and_rvals,
create_targets_and_rvals, LocalSymbol,
)
from .return_utils import handle_none_return, handle_xdp_return, is_xdp_name
@ -347,11 +347,12 @@ def process_func_body(
resolved_type = VmlinuxHandlerRegistry.get_struct_type(
context_type_name
)
context_type = {"type": ir.PointerType(resolved_type), "ptr": True}
context_type = LocalSymbol(None, ir.PointerType(resolved_type), resolved_type)
else:
try:
resolved_type = ctypes_to_ir(context_type_name)
context_type = {"type": ir.PointerType(resolved_type), "ptr": True}
logger.error("THIS SHOULD NOT HAPPEN. I THINK. PROBABLY.")
context_type = LocalSymbol(None, ir.PointerType(resolved_type), resolved_type)
except Exception:
raise TypeError(f"Type '{context_type_name}' not declared")