Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0564aaf

Browse files
authored
bpo-42099: Fix reference to ob_type in unionobject.c and ceval (GH-22829)
* Use Py_TYPE() rather than o->ob_type.
1 parent 15acc4e commit 0564aaf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Objects/unionobject.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ unionobject_dealloc(PyObject *self)
1515
unionobject *alias = (unionobject *)self;
1616

1717
Py_XDECREF(alias->args);
18-
self->ob_type->tp_free(self);
18+
Py_TYPE(self)->tp_free(self);
1919
}
2020

2121
static Py_hash_t

Python/ceval.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -3193,7 +3193,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
31933193

31943194
descr = _PyType_Lookup(type, name);
31953195
if (descr == NULL ||
3196-
descr->ob_type->tp_descr_get == NULL ||
3196+
Py_TYPE(descr)->tp_descr_get == NULL ||
31973197
!PyDescr_IsData(descr))
31983198
{
31993199
dictptr = (PyObject **) ((char *)owner + type->tp_dictoffset);

0 commit comments

Comments
 (0)