From 4ee0a2dfabb73903da716d374f2a853264b08470 Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Thu, 27 Nov 2008 12:10:36 +0100 Subject: [PATCH] Mark temp as not managed in buffer code (see previous commit notes) --- Cython/Compiler/ExprNodes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 78fd7779..eb780c82 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -1224,7 +1224,10 @@ class NameNode(AtomicExprNode): rhs.generate_post_assignment_code(code) def generate_acquire_buffer(self, rhs, code): - rhstmp = code.funcstate.allocate_temp(self.entry.type) + # rhstmp is only used in case the rhs is a complicated expression leading to + # the object, to avoid repeating the same C expression for every reference + # to the rhs. It does NOT hold a reference. + rhstmp = code.funcstate.allocate_temp(self.entry.type, manage_ref=False) buffer_aux = self.entry.buffer_aux bufstruct = buffer_aux.buffer_info_var.cname code.putln('%s = %s;' % (rhstmp, rhs.result_as(self.ctype()))) -- 2.26.2