Skip to content

Commit 3175756

Browse files
committed
Interpret bools as ints in binops
1 parent a756f5e commit 3175756

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pythonbpf/binary_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_operand_value(func, operand, builder, local_sym_tab):
2121
raise ValueError(f"Undefined variable: {operand.id}")
2222
elif isinstance(operand, ast.Constant):
2323
if isinstance(operand.value, int):
24-
cst = ir.Constant(ir.IntType(64), operand.value)
24+
cst = ir.Constant(ir.IntType(64), int(operand.value))
2525
return cst, [cst], None
2626
raise TypeError(f"Unsupported constant type: {type(operand.value)}")
2727
elif isinstance(operand, ast.BinOp):

0 commit comments

Comments
 (0)