Commits

Christian Heimes committed 39e3f06 Draft Merge

Py_TYPE() has already dereferenced self before the NULL check. Moved Py_TYPE() after the check for self == NULL

  • Participants
  • Parent commits 6bd9626, dcddbd4

Comments (0)

Files changed (1)

File Objects/classobject.c

 {
     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 = "?";
 
         PyErr_BadInternalCall();
         return NULL;
     }
+    klass = (PyObject*)Py_TYPE(self);
 
     funcname = _PyObject_GetAttrId(func, &PyId___name__);
     if (funcname == NULL) {