Skip to content

Commit c7f2955

Browse files
committed
Fix typo in process_stmt
1 parent ef36ea1 commit c7f2955

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pythonbpf/functions_pass.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def process_stmt(
411411
raise ValueError("Failed to evaluate return expression")
412412
if val[1] != ret_type:
413413
raise ValueError(
414-
"Return type mismatch: expected" f"{ret_type}, got {val[1]}"
414+
"Return type mismatch: expected " f"{ret_type}, got {val[1]}"
415415
)
416416
builder.ret(val[0])
417417
did_return = True
@@ -480,6 +480,9 @@ def allocate_mem(
480480
continue
481481
var_name = target.id
482482
rval = stmt.value
483+
if var_name in local_sym_tab:
484+
logger.info(f"Variable {var_name} already allocated")
485+
continue
483486
if isinstance(rval, ast.Call):
484487
if isinstance(rval.func, ast.Name):
485488
call_type = rval.func.id

0 commit comments

Comments
 (0)