GH-131498: Cases generator: manage stacks automatically (GH-132074)

This commit is contained in:
Mark Shannon 2025-04-04 17:59:36 +01:00 committed by GitHub
parent 305be5fb1a
commit 7099c75550
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 216 additions and 251 deletions

View file

@ -71,6 +71,9 @@ _Py_stackref_close(_PyStackRef ref, const char *filename, int linenumber)
}
PyObject *obj;
if (ref.index <= LAST_PREDEFINED_STACKREF_INDEX) {
if (ref.index == 0) {
_Py_FatalErrorFormat(__func__, "Passing NULL to PyStackRef_CLOSE at %s:%d\n", filename, linenumber);
}
// Pre-allocated reference to None, False or True -- Do not clear
TableEntry *entry = _Py_hashtable_get(interp->open_stackrefs_table, (void *)ref.index);
obj = entry->obj;