Commit 0962e3ff authored by Stefan Behnel's avatar Stefan Behnel

Avoid checking "signed" type attribute for non-numeric types (which don't have it).

parent f6cef1f3
...@@ -11533,9 +11533,11 @@ class DivNode(NumBinopNode): ...@@ -11533,9 +11533,11 @@ class DivNode(NumBinopNode):
def generate_evaluation_code(self, code): def generate_evaluation_code(self, code):
if not self.type.is_pyobject and not self.type.is_complex: if not self.type.is_pyobject and not self.type.is_complex:
if self.cdivision is None: if self.cdivision is None:
self.cdivision = (code.globalstate.directives['cdivision'] self.cdivision = (
or not self.type.signed code.globalstate.directives['cdivision']
or self.type.is_float) or self.type.is_float
or ((self.type.is_numeric or self.type.is_enum) and not self.type.signed)
)
if not self.cdivision: if not self.cdivision:
code.globalstate.use_utility_code( code.globalstate.use_utility_code(
UtilityCode.load_cached("DivInt", "CMath.c").specialize(self.type)) UtilityCode.load_cached("DivInt", "CMath.c").specialize(self.type))
......
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