mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
Interpret bools as ints in binops
This commit is contained in:
@ -21,7 +21,7 @@ def get_operand_value(func, operand, builder, local_sym_tab):
|
|||||||
raise ValueError(f"Undefined variable: {operand.id}")
|
raise ValueError(f"Undefined variable: {operand.id}")
|
||||||
elif isinstance(operand, ast.Constant):
|
elif isinstance(operand, ast.Constant):
|
||||||
if isinstance(operand.value, int):
|
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
|
return cst, [cst], None
|
||||||
raise TypeError(f"Unsupported constant type: {type(operand.value)}")
|
raise TypeError(f"Unsupported constant type: {type(operand.value)}")
|
||||||
elif isinstance(operand, ast.BinOp):
|
elif isinstance(operand, ast.BinOp):
|
||||||
|
|||||||
Reference in New Issue
Block a user