From 4eb270d863ec7beed1b52b5f8c5a252c8767e943 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 19 Dec 2008 20:15:56 +0100 Subject: [PATCH] fix previously introduced crash bug due to multiple temp allocation in comprehensions --- Cython/Compiler/ExprNodes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 07f029f4..08bc34b3 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -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() -- 2.26.2