From 317575644f9c5774ba7b633f82b0e47aff3a8dfe Mon Sep 17 00:00:00 2001 From: Pragyansh Chaturvedi Date: Sat, 11 Oct 2025 00:18:11 +0530 Subject: [PATCH] Interpret bools as ints in binops --- pythonbpf/binary_ops.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonbpf/binary_ops.py b/pythonbpf/binary_ops.py index 40417f8..0380ebd 100644 --- a/pythonbpf/binary_ops.py +++ b/pythonbpf/binary_ops.py @@ -21,7 +21,7 @@ def get_operand_value(func, operand, builder, local_sym_tab): raise ValueError(f"Undefined variable: {operand.id}") elif isinstance(operand, ast.Constant): if isinstance(operand.value, int): - cst = ir.Constant(ir.IntType(64), operand.value) + cst = ir.Constant(ir.IntType(64), int(operand.value)) return cst, [cst], None raise TypeError(f"Unsupported constant type: {type(operand.value)}") elif isinstance(operand, ast.BinOp):