GH-104584: Fix refleak when tracing through calls (GH-110593)

This commit is contained in:
Brandt Bucher 2023-10-10 10:29:48 +02:00 committed by GitHub
parent d5ec77fafd
commit 13380da91e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -0,0 +1 @@
Fix a reference leak when running with :envvar:`PYTHONUOPS` or :option:`-X uops <-X>` enabled.

View File

@ -288,7 +288,7 @@ _PyFunction_LookupByVersion(uint32_t version)
PyFunctionObject *func = interp->func_state.func_version_cache[
version % FUNC_VERSION_CACHE_SIZE];
if (func != NULL && func->func_version == version) {
return (PyFunctionObject *)Py_NewRef(func);
return func;
}
return NULL;
}