Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d01dc0 commit 40c9565Copy full SHA for 40c9565
2 files changed
Lib/test/crashers/borrowed_ref_1.py
@@ -0,0 +1,29 @@
1
+"""
2
+_PyType_Lookup() returns a borrowed reference.
3
+This attacks the call in dictobject.c.
4
5
+
6
+class A(object):
7
+ pass
8
9
+class B(object):
10
+ def __del__(self):
11
+ print('hi')
12
+ del D.__missing__
13
14
+class D(dict):
15
+ class __missing__:
16
+ def __init__(self, *args):
17
18
19
20
+d = D()
21
+a = A()
22
+a.cycle = a
23
+a.other = B()
24
+del a
25
26
+prev = None
27
+while 1:
28
+ d[5]
29
+ prev = (prev,)
Lib/test/crashers/borrowed_ref_2.py
0 commit comments