From: Dag Sverre Seljebotn Date: Sat, 21 Feb 2009 15:58:14 +0000 (+0100) Subject: new temps bug on indexing deletion X-Git-Tag: 0.11.rc~68 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=30867450349aac47b97eaa3cfc3b4179c498f1a7;p=cython.git new temps bug on indexing deletion --- 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"))