Converted IteratorNode to new temps, fixes #124
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Sat, 29 Nov 2008 22:20:51 +0000 (23:20 +0100)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Sat, 29 Nov 2008 22:20:51 +0000 (23:20 +0100)
Cython/Compiler/ExprNodes.py
tests/run/ticket_124.pyx [new file with mode: 0644]

index 0d20c53ba52691a278f5cac18627122c612dbc51..a29b2c6750dda3bbafdf85eec2340e2f381dfc4f 100644 (file)
@@ -1349,7 +1349,7 @@ class ImportNode(ExprNode):
                 code.error_goto_if_null(self.result(), self.pos)))
 
 
-class IteratorNode(ExprNode):
+class IteratorNode(NewTempExprNode):
     #  Used as part of for statement implementation.
     #
     #  allocate_counter_temp/release_counter_temp needs to be called
diff --git a/tests/run/ticket_124.pyx b/tests/run/ticket_124.pyx
new file mode 100644 (file)
index 0000000..5f9b23a
--- /dev/null
@@ -0,0 +1,8 @@
+"""
+>>> spam(dict(test=2))
+False
+"""
+def spam(dict d):
+    for elm in d:
+        return False
+    return True