From 83151f917a0a3e6417781dc04538bca972a7f499 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 2 Dec 2008 20:39:44 +0100 Subject: [PATCH] forgot to make the lhs in FlattenInListTransform a CloneNode --- Cython/Compiler/Optimize.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/Optimize.py b/Cython/Compiler/Optimize.py index a0f38f34..6dec163e 100644 --- a/Cython/Compiler/Optimize.py +++ b/Cython/Compiler/Optimize.py @@ -316,7 +316,7 @@ class FlattenInListTransform(Visitor.VisitorTransform): if len(args) == 0: return ExprNodes.BoolNode(pos = node.pos, value = node.operator == 'not_in') - if node.operand1.is_temp or node.operand1.is_simple(): + if node.operand1.is_simple(): lhs = node.operand1 else: # FIXME: allocate temp for evaluated node.operand1 @@ -334,6 +334,8 @@ class FlattenInListTransform(Visitor.VisitorTransform): pos = node.pos, operand = cond, type = PyrexTypes.c_bint_type)) + if type(lhs) is not ExprNodes.CloneNode: + lhs = ExprNodes.CloneNode(lhs) def concat(left, right): return ExprNodes.BoolBinopNode( pos = node.pos, -- 2.26.2