fix previously introduced crash bug due to multiple temp allocation in comprehensions
authorStefan Behnel <scoder@users.berlios.de>
Fri, 19 Dec 2008 19:15:56 +0000 (20:15 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Fri, 19 Dec 2008 19:15:56 +0000 (20:15 +0100)
Cython/Compiler/ExprNodes.py

index 07f029f4cf09b39ebf1fb22771599516e833dc72..08bc34b38c90fabf1b5a45f1f44ad694d9186ab1 100644 (file)
@@ -3189,12 +3189,14 @@ class ComprehensionNode(NewTempExprNode):
         self.type = self.target.type
         self.append.target = self # this is a CloneNode used in the PyList_Append in the inner loop
         self.loop.analyse_declarations(env)
-        self.loop.analyse_expressions(env)
 
     def allocate_temps(self, env, result = None): 
         if debug_temp_alloc:
             print("%s Allocating temps" % self)
         self.allocate_temp(env, result)
+        # call loop.analyse_expressions() now to make sure temps get
+        # allocated at the right time
+        self.loop.analyse_expressions(env)
 
     def calculate_result_code(self):
         return self.target.result()