From: Robert Bradshaw Date: Thu, 15 Jan 2009 09:46:28 +0000 (-0800) Subject: Fix for new temps and inplace ops X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6be28864c949dc31d77e1e7dae3f6a8734fad17a;p=cython.git Fix for new temps and inplace ops --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index dbbe1766..d2cf0b51 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -3045,14 +3045,18 @@ class InPlaceAssignmentNode(AssignmentNode): self.result_value.release_temp(env) def generate_execution_code(self, code): + import ExprNodes self.rhs.generate_evaluation_code(code) self.dup.generate_subexpr_evaluation_code(code) + if isinstance(self.dup, ExprNodes.NewTempExprNode): + # This is because we're manually messing with subexpr nodes + if self.dup.is_temp: + self.dup.allocate_temp_result(code) # self.dup.generate_result_code is run only if it is not buffer access if self.operator == "**": extra = ", Py_None" else: extra = "" - import ExprNodes if self.lhs.type.is_pyobject: if isinstance(self.lhs, ExprNodes.IndexNode) and self.lhs.is_buffer_access: error(self.pos, "In-place operators not allowed on object buffers in this release.")