diff options
author | Christian Heimes <christian@cheimes.de> | 2012-09-10 00:45:56 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2012-09-10 00:45:56 (GMT) |
commit | f03572d040f0f34b7fd3c1bcbd232d60b5a00d78 (patch) | |
tree | f5a7e62de3f21d7cc854ac8d21e09e4c5d0fbaa7 /Objects | |
parent | 1b5c76a2832e3fc3eb4d850b5bc69692bf23c83a (diff) | |
parent | 949f3317312c64425efae21bda86b98423aac9cf (diff) | |
download | cpython-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
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/classobject.c | 3 |
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) { |