coercions should always return a new node in order to support result reuse
authorStefan Behnel <scoder@users.berlios.de>
Sun, 25 Jul 2010 13:56:52 +0000 (15:56 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 25 Jul 2010 13:56:52 +0000 (15:56 +0200)
Cython/Compiler/ExprNodes.py

index ef0a361441416f95788e5ac6cec05d97f371f7ed..d9adbcaefaedac61cabad06a8099f8fd09b66fa2 100755 (executable)
@@ -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)