Commit 60f24e7f authored by Stefan Behnel's avatar Stefan Behnel

fix result types for C math operations on Python booleans

parent 78b216f5
...@@ -5651,7 +5651,12 @@ class NumBinopNode(BinopNode): ...@@ -5651,7 +5651,12 @@ class NumBinopNode(BinopNode):
def compute_c_result_type(self, type1, type2): def compute_c_result_type(self, type1, type2):
if self.c_types_okay(type1, type2): if self.c_types_okay(type1, type2):
return PyrexTypes.widest_numeric_type(type1, type2) widest_type = PyrexTypes.widest_numeric_type(type1, type2)
if widest_type is PyrexTypes.c_bint_type:
if self.operator not in '|^&':
# False + False == 0 # not False!
widest_type = PyrexTypes.c_int_type
return widest_type
else: else:
return None return None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment