From 6be28864c949dc31d77e1e7dae3f6a8734fad17a Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 15 Jan 2009 01:46:28 -0800 Subject: [PATCH] Fix for new temps and inplace ops --- Cython/Compiler/Nodes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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.") -- 2.26.2