gh-100227: Move func_state.next_version to PyInterpreterState (gh-102334)

https://github.com/python/cpython/issues/100227
This commit is contained in:
Eric Snow 2023-03-08 15:56:36 -07:00 • committed by GitHub
parent cbb0aa71d0
commit 66ff374d4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View file

@ -227,10 +227,11 @@ uint32_t _PyFunction_GetVersionForCurrentState(PyFunctionObject *func)
if (func->vectorcall != _PyFunction_Vectorcall) {
return 0;
}
if (_PyRuntime.func_state.next_version == 0) {
PyInterpreterState *interp = _PyInterpreterState_GET();
if (interp->func_state.next_version == 0) {
return 0;
}
uint32_t v = _PyRuntime.func_state.next_version++;
uint32_t v = interp->func_state.next_version++;
func->func_version = v;
return v;
}