Skip to content

Commit e4e9271

Browse files
committed
Move XDP pass above general return handling
1 parent f08bc99 commit e4e9271

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pythonbpf/functions/functions_pass.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,11 @@ def handle_if(
354354

355355

356356
def handle_return(builder, stmt, local_sym_tab, ret_type):
357+
logger.info(f"Handling return statement: {ast.dump(stmt)}")
357358
if stmt.value is None:
358359
return _handle_none_return(builder)
360+
elif isinstance(stmt.value, ast.Name):
361+
return _handle_xdp_return(stmt, builder, ret_type)
359362
elif (
360363
isinstance(stmt.value, ast.Call)
361364
and isinstance(stmt.value.func, ast.Name)
@@ -396,8 +399,6 @@ def handle_return(builder, stmt, local_sym_tab, ret_type):
396399
return True
397400
else:
398401
raise ValueError("Failed to evaluate return expression")
399-
elif isinstance(stmt.value, ast.Name):
400-
return _handle_xdp_return(stmt, builder, ret_type)
401402
else:
402403
raise ValueError("Unsupported return value")
403404

0 commit comments

Comments
 (0)