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
dff1834f
Kaydet (Commit)
dff1834f
authored
Tem 13, 2008
tarafından
Alexandre Vassalotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed _pickle to use Py_EnterRecursiveCall().
üst
2bc91df2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
11 deletions
+3
-11
_pickle.c
Modules/_pickle.c
+3
-11
No files found.
Modules/_pickle.c
Dosyayı görüntüle @
dff1834f
...
...
@@ -304,9 +304,6 @@ typedef struct PicklerObject {
PyObject
*
arg
;
int
proto
;
/* Pickle protocol number, >= 0 */
int
bin
;
/* Boolean, true if proto > 0 */
int
nesting
;
/* Current nesting level, this is to guard
save() from going into infinite recursion
and segfaulting. */
int
buf_size
;
/* Size of the current buffered pickle data */
char
*
write_buf
;
/* Write buffer, this is to avoid calling the
write() method of the output stream too
...
...
@@ -2075,12 +2072,8 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
PyObject
*
memo_key
=
NULL
;
int
status
=
0
;
/* XXX: Use Py_EnterRecursiveCall()? */
if
(
++
self
->
nesting
>
Py_GetRecursionLimit
())
{
PyErr_SetString
(
PyExc_RuntimeError
,
"maximum recursion depth exceeded"
);
goto
error
;
}
if
(
Py_EnterRecursiveCall
(
" while pickling an object"
)
<
0
)
return
-
1
;
/* The extra pers_save argument is necessary to avoid calling save_pers()
on its returned object. */
...
...
@@ -2273,7 +2266,7 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
status
=
-
1
;
}
done:
self
->
nesting
--
;
Py_LeaveRecursiveCall
()
;
Py_XDECREF
(
memo_key
);
Py_XDECREF
(
reduce_func
);
Py_XDECREF
(
reduce_value
);
...
...
@@ -2440,7 +2433,6 @@ Pickler_init(PicklerObject *self, PyObject *args, PyObject *kwds)
self
->
proto
=
proto
;
self
->
bin
=
proto
>
0
;
self
->
arg
=
NULL
;
self
->
nesting
=
0
;
self
->
fast
=
0
;
self
->
fast_nesting
=
0
;
self
->
fast_memo
=
NULL
;
...
...
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