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
a86c091a
Kaydet (Commit)
a86c091a
authored
Kas 18, 2014
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #22453: Fexed reference leaks when format error messages in ceval.c.
Warn against the use of leaking macro PyObject_REPR().
üst
ead2f5a0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
+25
-11
object.h
Include/object.h
+3
-1
ceval.c
Python/ceval.c
+16
-4
compile.c
Python/compile.c
+6
-6
No files found.
Include/object.h
Dosyayı görüntüle @
a86c091a
...
...
@@ -527,7 +527,9 @@ PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret;
PyAPI_DATA
(
int
)
_Py_HashSecret_Initialized
;
#endif
/* Helper for passing objects to printf and the like */
/* Helper for passing objects to printf and the like.
Leaks refcounts. Don't use it!
*/
#define PyObject_REPR(obj) PyString_AS_STRING(PyObject_Repr(obj))
/* Flag bits for printing: */
...
...
Python/ceval.c
Dosyayı görüntüle @
a86c091a
...
...
@@ -1957,9 +1957,13 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
if
(
err
==
0
)
continue
;
break
;
}
t
=
PyObject_Repr
(
w
);
if
(
t
==
NULL
)
break
;
PyErr_Format
(
PyExc_SystemError
,
"no locals found when storing %s"
,
PyObject_REPR
(
w
));
PyString_AS_STRING
(
t
));
Py_DECREF
(
t
);
break
;
case
DELETE_NAME
:
...
...
@@ -1971,9 +1975,13 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
w
);
break
;
}
t
=
PyObject_Repr
(
w
);
if
(
t
==
NULL
)
break
;
PyErr_Format
(
PyExc_SystemError
,
"no locals when deleting %s"
,
PyObject_REPR
(
w
));
PyString_AS_STRING
(
w
));
Py_DECREF
(
t
);
break
;
PREDICTED_WITH_ARG
(
UNPACK_SEQUENCE
);
...
...
@@ -2046,10 +2054,14 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
case
LOAD_NAME
:
w
=
GETITEM
(
names
,
oparg
);
if
((
v
=
f
->
f_locals
)
==
NULL
)
{
why
=
WHY_EXCEPTION
;
t
=
PyObject_Repr
(
w
);
if
(
t
==
NULL
)
break
;
PyErr_Format
(
PyExc_SystemError
,
"no locals when loading %s"
,
Py
Object_REPR
(
w
));
why
=
WHY_EXCEPTION
;
Py
String_AS_STRING
(
w
));
Py_DECREF
(
t
)
;
break
;
}
if
(
PyDict_CheckExact
(
v
))
{
...
...
Python/compile.c
Dosyayı görüntüle @
a86c091a
...
...
@@ -1271,11 +1271,11 @@ get_ref_type(struct compiler *c, PyObject *name)
"symbols: %s
\n
locals: %s
\n
globals: %s"
,
PyString_AS_STRING
(
name
),
PyString_AS_STRING
(
c
->
u
->
u_name
),
Py
Object_REPR
(
c
->
u
->
u_ste
->
ste_id
),
Py
String_AS_STRING
(
PyObject_Repr
(
c
->
u
->
u_ste
->
ste_id
)
),
c
->
c_filename
,
Py
Object_REPR
(
c
->
u
->
u_ste
->
ste_symbols
),
Py
Object_REPR
(
c
->
u
->
u_varnames
),
Py
Object_REPR
(
c
->
u
->
u_names
)
Py
String_AS_STRING
(
PyObject_Repr
(
c
->
u
->
u_ste
->
ste_symbols
)
),
Py
String_AS_STRING
(
PyObject_Repr
(
c
->
u
->
u_varnames
)
),
Py
String_AS_STRING
(
PyObject_Repr
(
c
->
u
->
u_names
)
)
);
Py_FatalError
(
buf
);
}
...
...
@@ -1327,11 +1327,11 @@ compiler_make_closure(struct compiler *c, PyCodeObject *co, int args)
if
(
arg
==
-
1
)
{
printf
(
"lookup %s in %s %d %d
\n
"
"freevars of %s: %s
\n
"
,
Py
Object_REPR
(
name
),
Py
String_AS_STRING
(
PyObject_Repr
(
name
)
),
PyString_AS_STRING
(
c
->
u
->
u_name
),
reftype
,
arg
,
PyString_AS_STRING
(
co
->
co_name
),
Py
Object_REPR
(
co
->
co_freevars
));
Py
String_AS_STRING
(
PyObject_Repr
(
co
->
co_freevars
)
));
Py_FatalError
(
"compiler_make_closure()"
);
}
ADDOP_I
(
c
,
LOAD_CLOSURE
,
arg
);
...
...
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