Mark temp as not managed in buffer code (see previous commit notes)
authorDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Thu, 27 Nov 2008 11:10:36 +0000 (12:10 +0100)
committerDag Sverre Seljebotn <dagss@student.matnat.uio.no>
Thu, 27 Nov 2008 11:10:36 +0000 (12:10 +0100)
Cython/Compiler/ExprNodes.py

index 78fd7779375e904d2720d4262e184e861f47d775..eb780c820a7ba57777d22e8ad139f1f52f02e6bc 100644 (file)
@@ -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())))