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
1d3e239f
Kaydet (Commit)
1d3e239f
authored
Agu 11, 2000
tarafından
Vladimir Marangozov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix missing decrements of the recursive counter in PyObject_Compare().
Closes Patch #101065.
üst
68933b94
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
object.c
Objects/object.c
+12
-6
No files found.
Objects/object.c
Dosyayı görüntüle @
1d3e239f
...
...
@@ -403,11 +403,13 @@ PyObject_Compare(PyObject *v, PyObject *w)
int
c
;
if
(
!
PyInstance_Check
(
v
))
return
-
PyObject_Compare
(
w
,
v
);
if
(
++
_PyCompareState_nesting
>
NESTING_LIMIT
)
{
_PyCompareState_nesting
++
;
if
(
_PyCompareState_nesting
>
NESTING_LIMIT
)
{
PyObject
*
inprogress
,
*
pair
;
inprogress
=
get_inprogress_dict
();
if
(
inprogress
==
NULL
)
{
_PyCompareState_nesting
--
;
return
-
1
;
}
pair
=
make_pair
(
v
,
w
);
...
...
@@ -415,20 +417,21 @@ PyObject_Compare(PyObject *v, PyObject *w)
/* already comparing these objects. assume
they're equal until shown otherwise */
Py_DECREF
(
pair
);
--
_PyCompareState_nesting
;
_PyCompareState_nesting
--
;
return
0
;
}
if
(
PyDict_SetItem
(
inprogress
,
pair
,
pair
)
==
-
1
)
{
_PyCompareState_nesting
--
;
return
-
1
;
}
res
=
do_cmp
(
v
,
w
);
_PyCompareState_nesting
--
;
/* XXX DelItem shouldn't fail */
PyDict_DelItem
(
inprogress
,
pair
);
Py_DECREF
(
pair
);
}
else
{
res
=
do_cmp
(
v
,
w
);
}
_PyCompareState_nesting
--
;
if
(
res
==
NULL
)
return
-
1
;
if
(
!
PyInt_Check
(
res
))
{
...
...
@@ -486,33 +489,36 @@ PyObject_Compare(PyObject *v, PyObject *w)
if
(
vtp
->
tp_compare
==
NULL
)
{
return
(
v
<
w
)
?
-
1
:
1
;
}
if
(
++
_PyCompareState_nesting
>
NESTING_LIMIT
_PyCompareState_nesting
++
;
if
(
_PyCompareState_nesting
>
NESTING_LIMIT
&&
(
vtp
->
tp_as_mapping
||
(
vtp
->
tp_as_sequence
&&
!
PyString_Check
(
v
))))
{
PyObject
*
inprogress
,
*
pair
;
inprogress
=
get_inprogress_dict
();
if
(
inprogress
==
NULL
)
{
_PyCompareState_nesting
--
;
return
-
1
;
}
pair
=
make_pair
(
v
,
w
);
if
(
PyDict_GetItem
(
inprogress
,
pair
))
{
/* already comparing these objects. assume
they're equal until shown otherwise */
_PyCompareState_nesting
--
;
Py_DECREF
(
pair
);
_PyCompareState_nesting
--
;
return
0
;
}
if
(
PyDict_SetItem
(
inprogress
,
pair
,
pair
)
==
-
1
)
{
_PyCompareState_nesting
--
;
return
-
1
;
}
result
=
(
*
vtp
->
tp_compare
)(
v
,
w
);
_PyCompareState_nesting
--
;
PyDict_DelItem
(
inprogress
,
pair
);
/* XXX shouldn't fail */
Py_DECREF
(
pair
);
}
else
{
result
=
(
*
vtp
->
tp_compare
)(
v
,
w
);
}
_PyCompareState_nesting
--
;
return
result
;
}
...
...
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