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
2a908f6b
Kaydet (Commit)
2a908f6b
authored
Ara 19, 2001
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
proxy_compare(): Make sure that we unwrap both objects being compared if
both are proxy objects.
üst
694ed091
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
weakrefobject.c
Objects/weakrefobject.c
+13
-6
No files found.
Objects/weakrefobject.c
Dosyayı görüntüle @
2a908f6b
...
...
@@ -220,6 +220,13 @@ proxy_checkref(PyWeakReference *proxy)
o = PyWeakref_GET_OBJECT(o); \
}
#define UNWRAP_I(o) \
if (PyWeakref_CheckProxy(o)) { \
if (!proxy_checkref((PyWeakReference *)o)) \
return -1; \
o = PyWeakref_GET_OBJECT(o); \
}
#define WRAP_UNARY(method, generic) \
static PyObject * \
method(PyObject *proxy) { \
...
...
@@ -284,11 +291,11 @@ proxy_setattr(PyWeakReference *proxy, PyObject *name, PyObject *value)
}
static
int
proxy_compare
(
Py
WeakReference
*
proxy
,
PyObject
*
v
)
proxy_compare
(
Py
Object
*
proxy
,
PyObject
*
v
)
{
if
(
!
proxy_checkref
(
proxy
))
return
-
1
;
return
PyObject_Compare
(
PyWeakref_GET_OBJECT
(
proxy
)
,
v
);
UNWRAP_I
(
proxy
);
UNWRAP_I
(
v
)
;
return
PyObject_Compare
(
proxy
,
v
);
}
/* number slots */
...
...
@@ -451,7 +458,7 @@ _PyWeakref_ProxyType = {
(
printfunc
)
proxy_print
,
/*tp_print*/
0
,
/*tp_getattr*/
0
,
/*tp_setattr*/
(
cmpfunc
)
proxy_compare
,
/*tp_compare*/
proxy_compare
,
/*tp_compare*/
(
unaryfunc
)
proxy_repr
,
/*tp_repr*/
&
proxy_as_number
,
/*tp_as_number*/
&
proxy_as_sequence
,
/*tp_as_sequence*/
...
...
@@ -482,7 +489,7 @@ _PyWeakref_CallableProxyType = {
(
printfunc
)
proxy_print
,
/*tp_print*/
0
,
/*tp_getattr*/
0
,
/*tp_setattr*/
(
cmpfunc
)
proxy_compare
,
/*tp_compare*/
proxy_compare
,
/*tp_compare*/
(
unaryfunc
)
proxy_repr
,
/*tp_repr*/
&
proxy_as_number
,
/*tp_as_number*/
&
proxy_as_sequence
,
/*tp_as_sequence*/
...
...
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