From: Dag Sverre Seljebotn Date: Sun, 30 Nov 2008 11:58:41 +0000 (+0100) Subject: Fix suboptimal temp usage in BoolBinopNode. For further improvements see #147. X-Git-Tag: 0.11-beta~176 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6a83f5ea1c1777207f802e18e670af0a2ea9cdf7;p=cython.git Fix suboptimal temp usage in BoolBinopNode. For further improvements see #147. --- diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index e734b3fa..0a682b04 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -4048,7 +4048,6 @@ class BoolBinopNode(NewTempExprNode): def generate_evaluation_code(self, code): code.mark_pos(self.pos) - self.allocate_temp_result(code) self.operand1.generate_evaluation_code(code) test_result, uses_temp = self.generate_operand1_test(code) if self.operator == 'and': @@ -4063,6 +4062,9 @@ class BoolBinopNode(NewTempExprNode): code.funcstate.release_temp(test_result) self.operand1.generate_disposal_code(code, free_temp=False) self.operand2.generate_evaluation_code(code) + + self.allocate_temp_result(code) + code.putln("%s = %s;" % (self.result(), self.operand2.result())) self.operand2.generate_disposal_code(code, decref=False) code.putln("} else {")