From ef502bcc9fb50177eefc0859c123329da2d3365b Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Thu, 11 Sep 2025 01:33:56 +0530 Subject: [PATCH] add error for unsupported constant --- examples/execve3.py | 1 + pythonbpf/functions_pass.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/examples/execve3.py b/examples/execve3.py index 1989704..abfd39c 100644 --- a/examples/execve3.py +++ b/examples/execve3.py @@ -43,6 +43,7 @@ def hello_again(ctx: c_void_p) -> c_int64: key = 4 last().update(key, ts) key = 5 + st = "st" last().update(key, ts) return c_int64(0) diff --git a/pythonbpf/functions_pass.py b/pythonbpf/functions_pass.py index 297f074..19a5161 100644 --- a/pythonbpf/functions_pass.py +++ b/pythonbpf/functions_pass.py @@ -53,6 +53,8 @@ def handle_assign(func, module, builder, stmt, map_sym_tab, local_sym_tab): local_sym_tab[var_name]) # local_sym_tab[var_name] = var print(f"Assigned constant {rval.value} to {var_name}") + else: + print("Unsupported constant type") elif isinstance(rval, ast.Call): if isinstance(rval.func, ast.Name): call_type = rval.func.id