projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d46fa3e
)
avoid recursive coercion in CoerceToPyTypeNode
author
Stefan Behnel
<scoder@users.berlios.de>
Thu, 18 Dec 2008 17:04:44 +0000
(18:04 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Thu, 18 Dec 2008 17:04:44 +0000
(18:04 +0100)
Cython/Compiler/ExprNodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ExprNodes.py
b/Cython/Compiler/ExprNodes.py
index 8e14914d95167a49f473aa29d2f4bbddb8388f57..c4bcd674185ded0ffb5591e09a4c30033aea79c7 100644
(file)
--- a/
Cython/Compiler/ExprNodes.py
+++ b/
Cython/Compiler/ExprNodes.py
@@
-4932,6
+4932,13
@@
class CoerceToPyTypeNode(CoercionNode):
def coerce_to_boolean(self, 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):
# The arg is always already analysed