Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
a0c05512
Kaydet (Commit)
a0c05512
authored
Eyl 10, 2007
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix a possible segfault from recursing too deep to get the repr of a list.
Closes issue #1096.
üst
f3d280e6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
list_tests.py
Lib/test/list_tests.py
+5
-0
NEWS
Misc/NEWS
+3
-0
listobject.c
Objects/listobject.c
+3
-0
No files found.
Lib/test/list_tests.py
Dosyayı görüntüle @
a0c05512
...
...
@@ -46,6 +46,11 @@ class CommonTest(seq_tests.CommonTest):
self
.
assertEqual
(
str
(
a2
),
"[0, 1, 2, [...], 3]"
)
self
.
assertEqual
(
repr
(
a2
),
"[0, 1, 2, [...], 3]"
)
l0
=
[]
for
i
in
xrange
(
sys
.
getrecursionlimit
()
+
100
):
l0
=
[
l0
]
self
.
assertRaises
(
RuntimeError
,
repr
,
l0
)
def
test_print
(
self
):
d
=
self
.
type2test
(
xrange
(
200
))
d
.
append
(
d
)
...
...
Misc/NEWS
Dosyayı görüntüle @
a0c05512
...
...
@@ -12,6 +12,9 @@ What's New in Python 2.6 alpha 1?
Core and builtins
-----------------
- Issue #1096: Prevent a segfault from getting the repr of a very deeply nested
list by using the recursion counter.
- Issue #1202533: Fix infinite recursion calls triggered by calls to
PyObject_Call() never calling back out to Python code to trigger recursion
depth updates/checks. Required the creation of a static RuntimeError
...
...
Objects/listobject.c
Dosyayı görüntüle @
a0c05512
...
...
@@ -324,7 +324,10 @@ list_repr(PyListObject *v)
so must refetch the list size on each iteration. */
for
(
i
=
0
;
i
<
Py_Size
(
v
);
++
i
)
{
int
status
;
if
(
Py_EnterRecursiveCall
(
" while getting the repr of a list"
))
goto
Done
;
s
=
PyObject_Repr
(
v
->
ob_item
[
i
]);
Py_LeaveRecursiveCall
();
if
(
s
==
NULL
)
goto
Done
;
status
=
PyList_Append
(
pieces
,
s
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment