summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-10 00:45:56 (GMT)
committerChristian Heimes <christian@cheimes.de>2012-09-10 00:45:56 (GMT)
commitf03572d040f0f34b7fd3c1bcbd232d60b5a00d78 (patch)
treef5a7e62de3f21d7cc854ac8d21e09e4c5d0fbaa7
parent1b5c76a2832e3fc3eb4d850b5bc69692bf23c83a (diff)
parent949f3317312c64425efae21bda86b98423aac9cf (diff)
downloadcpython-f03572d040f0f34b7fd3c1bcbd232d60b5a00d78.zip
cpython-f03572d040f0f34b7fd3c1bcbd232d60b5a00d78.tar.gz
cpython-f03572d040f0f34b7fd3c1bcbd232d60b5a00d78.tar.bz2
Py_TYPE() has already dereferenced self before the NULL check. Moved Py_TYPE() after the check for self == NULL
-rw-r--r--Objects/classobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index c481dd3..cdc9b1c 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -219,7 +219,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 = "?";
@@ -227,6 +227,7 @@ method_repr(PyMethodObject *a)
PyErr_BadInternalCall();
return NULL;
}
+ klass = (PyObject*)Py_TYPE(self);
funcname = _PyObject_GetAttrId(func, &PyId___name__);
if (funcname == NULL) {