mirror of
https://github.com/python/cpython
synced 2026-09-29 11:10:30 +03:00
Py_TYPE() has already dereferenced self before the NULL check. Moved Py_TYPE() after the check for self == NULL
This commit is contained in:
parent
941bfcc537
commit
949f331731
1 changed files with 2 additions and 1 deletions
|
|
@ -218,7 +218,7 @@ method_repr(PyMethodObject *a)
|
|||
{
|
||||
PyObject *self = a->im_self;
|
||||
PyObject *func = a->im_func;
|
||||
PyObject *klass = (PyObject*)Py_TYPE(self);
|
||||
PyObject *klass;
|
||||
PyObject *funcname = NULL ,*klassname = NULL, *result = NULL;
|
||||
char *defname = "?";
|
||||
|
||||
|
|
@ -226,6 +226,7 @@ method_repr(PyMethodObject *a)
|
|||
PyErr_BadInternalCall();
|
||||
return NULL;
|
||||
}
|
||||
klass = (PyObject*)Py_TYPE(self);
|
||||
|
||||
funcname = PyObject_GetAttrString(func, "__name__");
|
||||
if (funcname == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue