summaryrefslogtreecommitdiffstats
path: root/Objects/funcobject.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-03-08 22:56:36 (GMT)
committerGitHub <noreply@github.com>2023-03-08 22:56:36 (GMT)
commit66ff374d4f353ae427c148d2a1d141d223303a82 (patch)
treefc06c37106b1ad716e163b7ea14c6d8c175b1d4f /Objects/funcobject.c
parentcbb0aa71d040022db61390380b8aebc7c04f3275 (diff)
downloadcpython-66ff374d4f353ae427c148d2a1d141d223303a82.zip
cpython-66ff374d4f353ae427c148d2a1d141d223303a82.tar.gz
cpython-66ff374d4f353ae427c148d2a1d141d223303a82.tar.bz2
gh-100227: Move func_state.next_version to PyInterpreterState (gh-102334)
https://github.com/python/cpython/issues/100227
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r--Objects/funcobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 99048ea..ce5d7bd 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -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;
}