Commit ccd65093 authored by Stefan Behnel's avatar Stefan Behnel

avoid recursive coercion in CoerceToPyTypeNode

parent d46fa3e8
...@@ -4933,6 +4933,13 @@ class CoerceToPyTypeNode(CoercionNode): ...@@ -4933,6 +4933,13 @@ class CoerceToPyTypeNode(CoercionNode):
def coerce_to_boolean(self, env): def coerce_to_boolean(self, env):
return self.arg.coerce_to_boolean(env).coerce_to_temp(env) return self.arg.coerce_to_boolean(env).coerce_to_temp(env)
def coerce_to_integer(self, env):
# If not already some C integer type, coerce to longint.
if self.arg.type.is_int:
return self.arg
else:
return self.arg.coerce_to(PyrexTypes.c_long_type, env)
def analyse_types(self, env): def analyse_types(self, env):
# The arg is always already analysed # The arg is always already analysed
pass pass
......
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