From ba750d10784edac38e066df5cc82a10e8a5de9bb Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 25 Jul 2010 15:56:52 +0200 Subject: [PATCH] coercions should always return a new node in order to support result reuse --- Cython/Compiler/ExprNodes.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index ef0a3614..d9adbcae 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -5627,10 +5627,13 @@ class BoolBinopNode(ExprNode): or self.operand2.compile_time_value(denv) def coerce_to_boolean(self, env): - self.operand1 = self.operand1.coerce_to_boolean(env) - self.operand2 = self.operand2.coerce_to_boolean(env) - self.type = PyrexTypes.c_bint_type - return self + return BoolBinopNode( + self.pos, + operator = self.operator, + operand1 = self.operand1.coerce_to_boolean(env), + operand2 = self.operand2.coerce_to_boolean(env), + type = PyrexTypes.c_bint_type, + is_temp = self.is_temp) def analyse_types(self, env): self.operand1.analyse_types(env) -- 2.26.2