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
df0fd74a
Kaydet (Commit)
df0fd74a
authored
Eki 18, 2016
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #23782: Fixed possible memory leak in _PyTraceback_Add() and exception
loss in PyTraceBack_Here().
üst
c411a7d8
04eb7772
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
20 deletions
+29
-20
NEWS
Misc/NEWS
+3
-0
traceback.c
Python/traceback.c
+26
-20
No files found.
Misc/NEWS
Dosyayı görüntüle @
df0fd74a
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.6.0 beta 3
Core and Builtins
-----------------
- Issue #23782: Fixed possible memory leak in _PyTraceback_Add() and exception
loss in PyTraceBack_Here().
Library
-------
...
...
Python/traceback.c
Dosyayı görüntüle @
df0fd74a
...
...
@@ -132,47 +132,53 @@ newtracebackobject(PyTracebackObject *next, PyFrameObject *frame)
int
PyTraceBack_Here
(
PyFrameObject
*
frame
)
{
PyThreadState
*
tstate
=
PyThreadState_GET
();
PyTracebackObject
*
oldtb
=
(
PyTracebackObject
*
)
tstate
->
curexc_traceback
;
PyTracebackObject
*
tb
=
newtracebackobject
(
oldtb
,
frame
);
if
(
tb
==
NULL
)
PyObject
*
exc
,
*
val
,
*
tb
,
*
newtb
;
PyErr_Fetch
(
&
exc
,
&
val
,
&
tb
);
newtb
=
(
PyObject
*
)
newtracebackobject
((
PyTracebackObject
*
)
tb
,
frame
);
if
(
newtb
==
NULL
)
{
_PyErr_ChainExceptions
(
exc
,
val
,
tb
);
return
-
1
;
tstate
->
curexc_traceback
=
(
PyObject
*
)
tb
;
Py_XDECREF
(
oldtb
);
}
PyErr_Restore
(
exc
,
val
,
newtb
);
Py_XDECREF
(
tb
);
return
0
;
}
/* Insert a frame into the traceback for (funcname, filename, lineno). */
void
_PyTraceback_Add
(
const
char
*
funcname
,
const
char
*
filename
,
int
lineno
)
{
PyObject
*
globals
=
NULL
;
PyCodeObject
*
code
=
NULL
;
PyFrameObject
*
frame
=
NULL
;
PyObject
*
exc
eption
,
*
value
,
*
tb
;
PyObject
*
globals
;
PyCodeObject
*
code
;
PyFrameObject
*
frame
;
PyObject
*
exc
,
*
val
,
*
tb
;
/* Save and clear the current exception. Python functions must not be
called with an exception set. Calling Python functions happens when
the codec of the filesystem encoding is implemented in pure Python. */
PyErr_Fetch
(
&
exc
eption
,
&
value
,
&
tb
);
PyErr_Fetch
(
&
exc
,
&
val
,
&
tb
);
globals
=
PyDict_New
();
if
(
!
globals
)
goto
done
;
goto
error
;
code
=
PyCode_NewEmpty
(
filename
,
funcname
,
lineno
);
if
(
!
code
)
goto
done
;
if
(
!
code
)
{
Py_DECREF
(
globals
);
goto
error
;
}
frame
=
PyFrame_New
(
PyThreadState_Get
(),
code
,
globals
,
NULL
);
Py_DECREF
(
globals
);
Py_DECREF
(
code
);
if
(
!
frame
)
goto
done
;
goto
error
;
frame
->
f_lineno
=
lineno
;
PyErr_Restore
(
exc
eption
,
value
,
tb
);
PyErr_Restore
(
exc
,
val
,
tb
);
PyTraceBack_Here
(
frame
);
Py_DECREF
(
frame
);
return
;
done:
Py_XDECREF
(
globals
);
Py_XDECREF
(
code
);
Py_XDECREF
(
frame
);
error:
_PyErr_ChainExceptions
(
exc
,
val
,
tb
);
}
static
PyObject
*
...
...
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