]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42099: Fix reference to ob_type in unionobject.c and ceval (GH-22829)
authorNeil Schemenauer <nas-github@arctrix.com>
Tue, 27 Oct 2020 18:55:52 +0000 (11:55 -0700)
committerGitHub <noreply@github.com>
Tue, 27 Oct 2020 18:55:52 +0000 (18:55 +0000)
* Use Py_TYPE() rather than o->ob_type.

Objects/unionobject.c
Python/ceval.c

index 89fdaf42560c1b5b9bc3533bf17c4c8e59528591..1b7f8ab51a4ce2bdbea206a0229529d2474816e5 100644 (file)
@@ -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
index 7338be57798fd96e1e70afb320aab04657cb55a1..13b209fc706b6cf5b5725bfe1bc6407a696b124f 100644 (file)
@@ -3193,7 +3193,7 @@ main_loop:
 
                         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);