GH-108716: Turn off deep-freezing of code objects. (GH-108722)

This commit is contained in:
Mark Shannon 2023-09-08 10:34:40 +01:00 committed by GitHub
parent 00cf626cd4
commit 15d4c9fabc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 50 additions and 86 deletions

View file

@ -427,9 +427,10 @@ init_code(PyCodeObject *co, struct _PyCodeConstructor *con)
co->co_framesize = nlocalsplus + con->stacksize + FRAME_SPECIALS_SIZE;
co->co_ncellvars = ncellvars;
co->co_nfreevars = nfreevars;
co->co_version = _Py_next_func_version;
if (_Py_next_func_version != 0) {
_Py_next_func_version++;
PyInterpreterState *interp = _PyInterpreterState_GET();
co->co_version = interp->next_func_version;
if (interp->next_func_version != 0) {
interp->next_func_version++;
}
co->_co_monitoring = NULL;
co->_co_instrumentation_version = 0;