From c7f2955ee97ec318a757df17f63e2769cf34456a Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Sun, 5 Oct 2025 14:03:19 +0530 Subject: [PATCH] Fix typo in process_stmt --- pythonbpf/functions_pass.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pythonbpf/functions_pass.py b/pythonbpf/functions_pass.py index 019344c..d5537da 100644 --- a/pythonbpf/functions_pass.py +++ b/pythonbpf/functions_pass.py @@ -411,7 +411,7 @@ def process_stmt( raise ValueError("Failed to evaluate return expression") if val[1] != ret_type: raise ValueError( - "Return type mismatch: expected" f"{ret_type}, got {val[1]}" + "Return type mismatch: expected " f"{ret_type}, got {val[1]}" ) builder.ret(val[0]) did_return = True @@ -480,6 +480,9 @@ def allocate_mem( continue var_name = target.id rval = stmt.value + if var_name in local_sym_tab: + logger.info(f"Variable {var_name} already allocated") + continue if isinstance(rval, ast.Call): if isinstance(rval.func, ast.Name): call_type = rval.func.id