Skip to content

Commit ef36ea1

Browse files
committed
Add nullcheck for var_name in handle_binary_ops
1 parent d341cb2 commit ef36ea1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pythonbpf/binary_ops.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ def handle_binary_op_impl(rval, builder, local_sym_tab):
6464

6565
def handle_binary_op(rval, builder, var_name, local_sym_tab):
6666
result = handle_binary_op_impl(rval, builder, local_sym_tab)
67-
if var_name in local_sym_tab:
67+
if var_name and var_name in local_sym_tab:
68+
logger.info(
69+
f"Storing result {result} into variable {local_sym_tab[var_name].var}"
70+
)
6871
builder.store(result, local_sym_tab[var_name].var)
6972
return result, result.type

0 commit comments

Comments
 (0)