summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-11-18 22:11:05 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-11-18 22:11:05 (GMT)
commita86c091a736020d823f1676acec7319bc5493f2c (patch)
treecaafa779077224cfdb8549e03dcf23f43fb5cd18 /Python/compile.c
parentead2f5a027c2bb92a1b476c72f1ef50dcec32092 (diff)
downloadcpython-a86c091a736020d823f1676acec7319bc5493f2c.zip
cpython-a86c091a736020d823f1676acec7319bc5493f2c.tar.gz
cpython-a86c091a736020d823f1676acec7319bc5493f2c.tar.bz2
Issue #22453: Fexed reference leaks when format error messages in ceval.c.
Warn against the use of leaking macro PyObject_REPR().
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 1cf53f9..9d9e629 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1271,11 +1271,11 @@ get_ref_type(struct compiler *c, PyObject *name)
"symbols: %s\nlocals: %s\nglobals: %s",
PyString_AS_STRING(name),
PyString_AS_STRING(c->u->u_name),
- PyObject_REPR(c->u->u_ste->ste_id),
+ PyString_AS_STRING(PyObject_Repr(c->u->u_ste->ste_id)),
c->c_filename,
- PyObject_REPR(c->u->u_ste->ste_symbols),
- PyObject_REPR(c->u->u_varnames),
- PyObject_REPR(c->u->u_names)
+ PyString_AS_STRING(PyObject_Repr(c->u->u_ste->ste_symbols)),
+ PyString_AS_STRING(PyObject_Repr(c->u->u_varnames)),
+ PyString_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",
- PyObject_REPR(name),
+ PyString_AS_STRING(PyObject_Repr(name)),
PyString_AS_STRING(c->u->u_name),
reftype, arg,
PyString_AS_STRING(co->co_name),
- PyObject_REPR(co->co_freevars));
+ PyString_AS_STRING(PyObject_Repr(co->co_freevars)));
Py_FatalError("compiler_make_closure()");
}
ADDOP_I(c, LOAD_CLOSURE, arg);