From 3a6a907accf4bacc5ab7826bf66ddefb2245d89f Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Sun, 30 Nov 2008 13:45:16 +0100 Subject: [PATCH] Fix for temp releasing in assignment to TupleNode --- Cython/Compiler/ExprNodes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 0a682b04..59b9d7ab 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -2850,7 +2850,7 @@ class SequenceNode(NewTempExprNode): code.put_incref(item.result(), item.ctype()) value_node = self.coerced_unpacked_items[i] value_node.generate_evaluation_code(code) - rhs.generate_disposal_code(code) + rhs.generate_disposal_code(code, free_temp=False) code.putln("} else {") @@ -2859,7 +2859,7 @@ class SequenceNode(NewTempExprNode): self.iterator.result(), rhs.py_result(), code.error_goto_if_null(self.iterator.result(), self.pos))) - rhs.generate_disposal_code(code) + rhs.generate_disposal_code(code, free_temp=False) for i in range(len(self.args)): item = self.unpacked_items[i] unpack_code = "__Pyx_UnpackItem(%s, %d)" % ( @@ -2880,6 +2880,7 @@ class SequenceNode(NewTempExprNode): self.iterator.generate_disposal_code(code) code.putln("}") + rhs.generate_disposal_code(code, free_temp=True, decref=False) for i in range(len(self.args)): self.args[i].generate_assignment_code( self.coerced_unpacked_items[i], code) -- 2.26.2