mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-116916: Remove separate next_func_version counter (#116918)
Somehow we ended up with two separate counter variables tracking "the next function version". Most likely this was a historical accident where an old branch was updated incorrectly. This PR merges the two counters into a single one: `interp->func_state.next_version`.
This commit is contained in:
parent
76d0868907
commit
7e1f38f2de
4 changed files with 7 additions and 9 deletions
|
@ -415,9 +415,9 @@ init_code(PyCodeObject *co, struct _PyCodeConstructor *con)
|
|||
co->co_ncellvars = ncellvars;
|
||||
co->co_nfreevars = nfreevars;
|
||||
PyInterpreterState *interp = _PyInterpreterState_GET();
|
||||
co->co_version = interp->next_func_version;
|
||||
if (interp->next_func_version != 0) {
|
||||
interp->next_func_version++;
|
||||
co->co_version = interp->func_state.next_version;
|
||||
if (interp->func_state.next_version != 0) {
|
||||
interp->func_state.next_version++;
|
||||
}
|
||||
co->_co_monitoring = NULL;
|
||||
co->_co_instrumentation_version = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue