[Python-checkins] bpo-42099: Fix reference to ob_type in unionobject.c and ceval (GH-22829)

markshannon webhook-mailer at python.org
Tue Oct 27 14:56:03 EDT 2020


https://github.com/python/cpython/commit/0564aafb71a153dd0aca4b9266dfae9336a4f2cb
commit: 0564aafb71a153dd0aca4b9266dfae9336a4f2cb
branch: master
author: Neil Schemenauer <nas-github at arctrix.com>
committer: markshannon <mark at hotpy.org>
date: 2020-10-27T18:55:52Z
summary:

bpo-42099: Fix reference to ob_type in unionobject.c and ceval (GH-22829)

* Use Py_TYPE() rather than o->ob_type.

files:
M Objects/unionobject.c
M Python/ceval.c

diff --git a/Objects/unionobject.c b/Objects/unionobject.c
index 89fdaf42560c1..1b7f8ab51a4ce 100644
--- a/Objects/unionobject.c
+++ b/Objects/unionobject.c
@@ -15,7 +15,7 @@ unionobject_dealloc(PyObject *self)
     unionobject *alias = (unionobject *)self;
 
     Py_XDECREF(alias->args);
-    self->ob_type->tp_free(self);
+    Py_TYPE(self)->tp_free(self);
 }
 
 static Py_hash_t
diff --git a/Python/ceval.c b/Python/ceval.c
index 7338be57798fd..13b209fc706b6 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3193,7 +3193,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
 
                         descr = _PyType_Lookup(type, name);
                         if (descr == NULL ||
-                            descr->ob_type->tp_descr_get == NULL ||
+                            Py_TYPE(descr)->tp_descr_get == NULL ||
                             !PyDescr_IsData(descr))
                         {
                             dictptr = (PyObject **) ((char *)owner + type->tp_dictoffset);



More information about the Python-checkins mailing list