summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2022-08-15 11:29:27 (GMT)
committerGitHub <noreply@github.com>2022-08-15 11:29:27 (GMT)
commit3ef3c6306def489ba9115f0a8a57ab1e99795a5c (patch)
treef74aa199f7051f57b4577f9a920cf982766a65b4 /Objects/object.c
parent4a7f5a55dc88c14cef880ae38a96018514ca9d83 (diff)
downloadcpython-3ef3c6306def489ba9115f0a8a57ab1e99795a5c.zip
cpython-3ef3c6306def489ba9115f0a8a57ab1e99795a5c.tar.gz
cpython-3ef3c6306def489ba9115f0a8a57ab1e99795a5c.tar.bz2
GH-95707: Fix uses of `Py_TPFLAGS_MANAGED_DICT` (GH-95854)
* Make sure that tp_dictoffset is correct with Py_TPFLAGS_MANAGED_DICT is set. * Avoid traversing managed dict twice when subclassing class with Py_TPFLAGS_MANAGED_DICT set.
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c
index a90c6fa..9bbe0ee 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1064,6 +1064,7 @@ _PyObject_ComputedDictPointer(PyObject *obj)
if (dictoffset == 0)
return NULL;
if (dictoffset < 0) {
+ assert(dictoffset != -1);
Py_ssize_t tsize = Py_SIZE(obj);
if (tsize < 0) {
tsize = -tsize;