summaryrefslogtreecommitdiffstats
path: root/Lib/test/crashers
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-03-08 23:44:13 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-03-08 23:44:13 (GMT)
commit2d01dc00bc4ca3eb0cf1cc1ee44859a4eaf165d9 (patch)
tree477cdcbe6c0848ad892859fbbaad3c0ff8a5d718 /Lib/test/crashers
parentd74782b0ac7dc5c7b8b7ca575829f2f33af66684 (diff)
downloadcpython-2d01dc00bc4ca3eb0cf1cc1ee44859a4eaf165d9.zip
cpython-2d01dc00bc4ca3eb0cf1cc1ee44859a4eaf165d9.tar.gz
cpython-2d01dc00bc4ca3eb0cf1cc1ee44859a4eaf165d9.tar.bz2
Issue #14211: _PyObject_GenericSetAttrWithDict() keeps a strong reference to
the descriptor because it may be destroyed before being used, destroyed during the update of the dict for example.
Diffstat (limited to 'Lib/test/crashers')
-rw-r--r--Lib/test/crashers/borrowed_ref_1.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/Lib/test/crashers/borrowed_ref_1.py b/Lib/test/crashers/borrowed_ref_1.py
deleted file mode 100644
index b82f464..0000000
--- a/Lib/test/crashers/borrowed_ref_1.py
+++ /dev/null
@@ -1,29 +0,0 @@
-"""
-_PyType_Lookup() returns a borrowed reference.
-This attacks the call in dictobject.c.
-"""
-
-class A(object):
- pass
-
-class B(object):
- def __del__(self):
- print('hi')
- del D.__missing__
-
-class D(dict):
- class __missing__:
- def __init__(self, *args):
- pass
-
-
-d = D()
-a = A()
-a.cycle = a
-a.other = B()
-del a
-
-prev = None
-while 1:
- d[5]
- prev = (prev,)