diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2012-03-08 23:52:07 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2012-03-08 23:52:07 (GMT) |
commit | 40c9565bcc42eef2cf72ae23056992227f15cacc (patch) | |
tree | 260b247d2dd472d474a985dcf6b3a6b2514864bb /Lib/test/crashers/borrowed_ref_2.py | |
parent | 2d01dc00bc4ca3eb0cf1cc1ee44859a4eaf165d9 (diff) | |
download | cpython-40c9565bcc42eef2cf72ae23056992227f15cacc.zip cpython-40c9565bcc42eef2cf72ae23056992227f15cacc.tar.gz cpython-40c9565bcc42eef2cf72ae23056992227f15cacc.tar.bz2 |
Issue #14211: Oops, I removed the wrong file :-)
Diffstat (limited to 'Lib/test/crashers/borrowed_ref_2.py')
-rw-r--r-- | Lib/test/crashers/borrowed_ref_2.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/Lib/test/crashers/borrowed_ref_2.py b/Lib/test/crashers/borrowed_ref_2.py deleted file mode 100644 index 6e403eb..0000000 --- a/Lib/test/crashers/borrowed_ref_2.py +++ /dev/null @@ -1,38 +0,0 @@ -""" -_PyType_Lookup() returns a borrowed reference. -This attacks PyObject_GenericSetAttr(). - -NB. on my machine this crashes in 2.5 debug but not release. -""" - -class A(object): - pass - -class B(object): - def __del__(self): - print("hi") - del C.d - -class D(object): - def __set__(self, obj, value): - self.hello = 42 - -class C(object): - d = D() - - def g(): - pass - - -c = C() -a = A() -a.cycle = a -a.other = B() - -lst = [None] * 1000000 -i = 0 -del a -while 1: - c.d = 42 # segfaults in PyMethod_New(__func__=D.__set__, __self__=d) - lst[i] = c.g # consume the free list of instancemethod objects - i += 1 |