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
e6dd31c5
Kaydet (Commit)
e6dd31c5
authored
Agu 14, 2006
tarafından
Thomas Heller
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Revert the change that tries to zero out a closure's result storage
area because the size if unknown in source/callproc.c.
üst
dca703fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
15 deletions
+5
-15
callbacks.c
Modules/_ctypes/callbacks.c
+5
-15
No files found.
Modules/_ctypes/callbacks.c
Dosyayı görüntüle @
e6dd31c5
...
...
@@ -205,24 +205,14 @@ if (x == NULL) _AddTraceback(what, __FILE__, __LINE__ - 1), PyErr_Print()
result
=
PyObject_CallObject
(
callable
,
arglist
);
CHECK
(
"'calling callback function'"
,
result
);
#ifdef WORDS_BIGENDIAN
/* See the corresponding code in callproc.c, around line 961 */
if
(
restype
->
type
!=
FFI_TYPE_FLOAT
&&
restype
->
size
<
sizeof
(
ffi_arg
))
mem
=
(
char
*
)
mem
+
sizeof
(
ffi_arg
)
-
restype
->
size
;
#endif
/* The code that converts 'result' into C data is not executed when
'callable' returns Py_None, so we zero out the memory that will
receive the C return data to not return random data.
Cleaner would be to call 'setfunc' anyway and complain with
PyErr_WriteUnraisable(), but ctypes has always accepted a Py_None
return value for *any* 'restype' and it would probably break too
much code if this is changed now.
*/
memset
(
mem
,
0
,
restype
->
size
);
if
((
restype
!=
&
ffi_type_void
)
&&
result
&&
result
!=
Py_None
)
{
PyObject
*
keep
;
assert
(
setfunc
);
#ifdef WORDS_BIGENDIAN
/* See the corresponding code in callproc.c, around line 961 */
if
(
restype
->
type
!=
FFI_TYPE_FLOAT
&&
restype
->
size
<
sizeof
(
ffi_arg
))
mem
=
(
char
*
)
mem
+
sizeof
(
ffi_arg
)
-
restype
->
size
;
#endif
keep
=
setfunc
(
mem
,
result
,
0
);
CHECK
(
"'converting callback result'"
,
keep
);
/* keep is an object we have to keep alive so that the 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