fix compiler crash
authorStefan Behnel <stefan_ml@behnel.de>
Sun, 8 Dec 2013 14:12:55 +0000 (15:12 +0100)
committerStefan Behnel <stefan_ml@behnel.de>
Sun, 8 Dec 2013 14:12:55 +0000 (15:12 +0100)
Cython/Compiler/Optimize.py

index b558657..7164863 100644 (file)
@@ -3394,6 +3394,9 @@ class ConstantFolding(Visitor.VisitorTransform, SkipDeclarations):
 
     def visit_ExprStatNode(self, node):
         self.visitchildren(node)
+        if not isinstance(node.expr, ExprNodes.ExprNode):
+            # ParallelRangeTransform does this ...
+            return node
         # drop unused constant expressions
         if node.expr.has_constant_result():
             return None