From 30867450349aac47b97eaa3cfc3b4179c498f1a7 Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Sat, 21 Feb 2009 16:58:14 +0100 Subject: [PATCH] new temps bug on indexing deletion --- Cython/Compiler/ExprNodes.py | 1 + tests/run/delete.pyx | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/run/delete.pyx diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 47f265ec..8ab9019e 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -1925,6 +1925,7 @@ class IndexNode(ExprNode): self.index_unsigned_parameter(), code.error_goto(self.pos))) self.generate_subexpr_disposal_code(code) + self.free_subexpr_temps(code) def buffer_lookup_code(self, code): # Assign indices to temps diff --git a/tests/run/delete.pyx b/tests/run/delete.pyx new file mode 100644 index 00000000..b6cc2c0f --- /dev/null +++ b/tests/run/delete.pyx @@ -0,0 +1,18 @@ +""" +>>> a = A() +>>> a.f() +[2, 1] +>>> a.g() +(False, True) +""" + +class A: + def f(self): + self.refs = [3,2,1] + del self.refs[0] + return self.refs + + def g(self): + self.a = 3 + del self.a + return (hasattr(self, "a"), hasattr(self, "g")) -- 2.26.2