From d2e0f17ca821e57bbf8be356155e2fefd5a22e7b Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Wed, 1 Oct 2025 18:14:09 +0530 Subject: [PATCH] Use key_arg instead of call in get_key_ptr --- pythonbpf/helper/helper_utils.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pythonbpf/helper/helper_utils.py b/pythonbpf/helper/helper_utils.py index 3594c3c..4b7cbbd 100644 --- a/pythonbpf/helper/helper_utils.py +++ b/pythonbpf/helper/helper_utils.py @@ -37,13 +37,8 @@ def create_int_constant_ptr(value, builder, int_width=64): return ptr -def get_key_ptr(call, builder, local_sym_tab): +def get_key_ptr(key_arg, builder, local_sym_tab): """Extract key pointer from the call arguments.""" - if not call.args or len(call.args) != 1: - raise ValueError("Map lookup expects exactly one argument, got " - f"{len(call.args)}") - - key_arg = call.args[0] if isinstance(key_arg, ast.Name): key_ptr = get_var_ptr_from_name(key_arg.id, local_sym_tab)