Kaydet (Commit) f03572d0 authored tarafından Christian Heimes's avatar Christian Heimes

Py_TYPE() has already dereferenced self before the NULL check. Moved Py_TYPE()…

Py_TYPE() has already dereferenced self before the NULL check. Moved Py_TYPE() after the check for self == NULL
...@@ -219,7 +219,7 @@ method_repr(PyMethodObject *a) ...@@ -219,7 +219,7 @@ method_repr(PyMethodObject *a)
{ {
PyObject *self = a->im_self; PyObject *self = a->im_self;
PyObject *func = a->im_func; PyObject *func = a->im_func;
PyObject *klass = (PyObject*)Py_TYPE(self); PyObject *klass;
PyObject *funcname = NULL ,*klassname = NULL, *result = NULL; PyObject *funcname = NULL ,*klassname = NULL, *result = NULL;
char *defname = "?"; char *defname = "?";
...@@ -227,6 +227,7 @@ method_repr(PyMethodObject *a) ...@@ -227,6 +227,7 @@ method_repr(PyMethodObject *a)
PyErr_BadInternalCall(); PyErr_BadInternalCall();
return NULL; return NULL;
} }
klass = (PyObject*)Py_TYPE(self);
funcname = _PyObject_GetAttrId(func, &PyId___name__); funcname = _PyObject_GetAttrId(func, &PyId___name__);
if (funcname == NULL) { if (funcname == NULL) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment