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
8d5cf4ed
Kaydet (Commit)
8d5cf4ed
authored
Ock 25, 2008
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rewrite the list_inline_repeat overflow check slightly differently.
üst
3dbd4c53
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
listobject.c
Objects/listobject.c
+7
-6
No files found.
Objects/listobject.c
Dosyayı görüntüle @
8d5cf4ed
...
...
@@ -502,7 +502,7 @@ list_repeat(PyListObject *a, Py_ssize_t n)
if
(
n
&&
size
/
n
!=
Py_SIZE
(
a
))
return
PyErr_NoMemory
();
if
(
size
==
0
)
return
PyList_New
(
0
);
return
PyList_New
(
0
);
np
=
(
PyListObject
*
)
PyList_New
(
size
);
if
(
np
==
NULL
)
return
NULL
;
...
...
@@ -669,11 +669,11 @@ static PyObject *
list_inplace_repeat
(
PyListObject
*
self
,
Py_ssize_t
n
)
{
PyObject
**
items
;
Py_ssize_t
size
,
i
,
j
,
p
,
newsize
;
Py_ssize_t
size
,
i
,
j
,
p
;
size
=
PyList_GET_SIZE
(
self
);
if
(
size
==
0
)
{
if
(
size
==
0
||
n
==
1
)
{
Py_INCREF
(
self
);
return
(
PyObject
*
)
self
;
}
...
...
@@ -684,10 +684,11 @@ list_inplace_repeat(PyListObject *self, Py_ssize_t n)
return
(
PyObject
*
)
self
;
}
newsize
=
size
*
n
;
if
(
newsize
/
n
!=
size
)
if
(
size
>
SSIZE_MAX
/
n
)
{
return
PyErr_NoMemory
();
if
(
list_resize
(
self
,
newsize
)
==
-
1
)
}
if
(
list_resize
(
self
,
size
*
n
)
==
-
1
)
return
NULL
;
p
=
size
;
...
...
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