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
632fad39
Kaydet (Commit)
632fad39
authored
Şub 16, 2008
tarafından
Amaury Forgeot d'Arc
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Prevent a crash with nested scopes, again caused by calling Py_DECREF when the pointer
is still present in the containing structure.
üst
588ff93f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
test_scope.py
Lib/test/test_scope.py
+18
-0
NEWS
Misc/NEWS
+3
-0
cellobject.c
Objects/cellobject.c
+3
-1
No files found.
Lib/test/test_scope.py
Dosyayı görüntüle @
632fad39
...
...
@@ -597,6 +597,24 @@ self.assert_(X.passed)
f
(
4
)()
def
testFreeingCell
(
self
):
# Test what happens when a finalizer accesses
# the cell where the object was stored.
class
Special
:
def
__del__
(
self
):
nestedcell_get
()
def
f
():
global
nestedcell_get
def
nestedcell_get
():
return
c
c
=
(
Special
(),)
c
=
2
f
()
# used to crash the interpreter...
def
test_main
():
run_unittest
(
ScopeTests
)
...
...
Misc/NEWS
Dosyayı görüntüle @
632fad39
...
...
@@ -12,6 +12,9 @@ What's New in Python 2.6 alpha 1?
Core and builtins
-----------------
- Fixed several potential crashes, all caused by specially crafted __del__
methods exploiting objects in temporarily inconsistent state.
- Issue #2115: Important speedup in setting __slot__ attributes. Also
prevent a possible crash: an Abstract Base Class would try to access a slot
on a registered virtual subclass.
...
...
Objects/cellobject.c
Dosyayı görüntüle @
632fad39
...
...
@@ -31,13 +31,15 @@ PyCell_Get(PyObject *op)
int
PyCell_Set
(
PyObject
*
op
,
PyObject
*
obj
)
{
PyObject
*
oldobj
;
if
(
!
PyCell_Check
(
op
))
{
PyErr_BadInternalCall
();
return
-
1
;
}
Py_XDECREF
(((
PyCellObject
*
)
op
)
->
ob_ref
);
oldobj
=
PyCell_GET
(
op
);
Py_XINCREF
(
obj
);
PyCell_SET
(
op
,
obj
);
Py_XDECREF
(
oldobj
);
return
0
;
}
...
...
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