C type casts are 'simple'
authorStefan Behnel <scoder@users.berlios.de>
Fri, 28 Jan 2011 06:51:36 +0000 (07:51 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 28 Jan 2011 06:51:36 +0000 (07:51 +0100)
Cython/Compiler/ExprNodes.py

index fe5463bf94a7efe7c2fb5f47b261afb83fb6cb98..43c7d3ba3337b727a5b55f3240476d79c43d480e 100755 (executable)
@@ -5388,6 +5388,10 @@ class TypecastNode(ExprNode):
         elif self.type.is_complex and self.operand.type.is_complex:
             self.operand = self.operand.coerce_to_simple(env)
 
+    def is_simple(self):
+        # either temp or a C cast => no side effects
+        return True
+
     def nogil_check(self, env):
         if self.type and self.type.is_pyobject and self.is_temp:
             self.gil_error()