diff options
author | Mark Shannon <mark@hotpy.org> | 2024-12-20 16:52:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-20 16:52:20 (GMT) |
commit | 128cc47fbd44e3e09c50d9674fe4a4bba3be450c (patch) | |
tree | 12147152fb9afa9a4dffe14e9f4350dd39f1956c /Objects | |
parent | 78ffba4221dcb2e39fd5db80c297d1777588bb59 (diff) | |
download | cpython-128cc47fbd44e3e09c50d9674fe4a4bba3be450c.zip cpython-128cc47fbd44e3e09c50d9674fe4a4bba3be450c.tar.gz cpython-128cc47fbd44e3e09c50d9674fe4a4bba3be450c.tar.bz2 |
GH-127705: Add debug mode for `_PyStackRef`s inspired by HPy debug mode (GH-128121)
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/frameobject.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 03ed2b9..10fd3a9 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -179,9 +179,9 @@ framelocalsproxy_setitem(PyObject *self, PyObject *key, PyObject *value) if (kind == CO_FAST_FREE) { // The cell was set when the frame was created from // the function's closure. - assert(oldvalue.bits != 0 && PyCell_Check(PyStackRef_AsPyObjectBorrow(oldvalue))); + assert(!PyStackRef_IsNull(oldvalue) && PyCell_Check(PyStackRef_AsPyObjectBorrow(oldvalue))); cell = PyStackRef_AsPyObjectBorrow(oldvalue); - } else if (kind & CO_FAST_CELL && oldvalue.bits != 0) { + } else if (kind & CO_FAST_CELL && !PyStackRef_IsNull(oldvalue)) { PyObject *as_obj = PyStackRef_AsPyObjectBorrow(oldvalue); if (PyCell_Check(as_obj)) { cell = as_obj; |