mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-127705: Add debug mode for _PyStackRef
s inspired by HPy debug mode (GH-128121)
This commit is contained in:
parent
78ffba4221
commit
128cc47fbd
12 changed files with 395 additions and 33 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue