fix temp var leak in for-range to for-from transformation
authorStefan Behnel <scoder@users.berlios.de>
Sun, 4 Oct 2009 12:42:13 +0000 (14:42 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 4 Oct 2009 12:42:13 +0000 (14:42 +0200)
Cython/Compiler/Nodes.py

index bdfd275bf2497af14bed464d7f3ddcb3be8364ce..4873ace4d862373ef1356f0da1812279985194bb 100644 (file)
@@ -3971,6 +3971,8 @@ class ForFromStatNode(LoopNode, StatNode):
             # depend on whether or not the loop is a python type. 
             self.py_loopvar_node.generate_evaluation_code(code)
             self.target.generate_assignment_code(self.py_loopvar_node, code)
+        if from_range:
+            code.funcstate.release_temp(loopvar_name)
         break_label = code.break_label
         code.set_loop_labels(old_loop_labels)
         if self.else_clause: