From da57eed349d43d00e0fdb49a5c953c8d4b69f28d Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Tue, 10 Oct 2023 00:47:18 -0700 Subject: [PATCH 1/3] _PyFunction_LookupByVersion returns a borrowed ref --- Objects/funcobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 231a9c141d0c0b..e8ad486150da47 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -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; } From f3a6962e7f6c63f13e566178a00a72ca2632017d Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Tue, 10 Oct 2023 00:49:42 -0700 Subject: [PATCH 2/3] blurb add --- .../2023-10-10-00-49-35.gh-issue-106908.z94TuJ.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2023-10-10-00-49-35.gh-issue-106908.z94TuJ.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-10-10-00-49-35.gh-issue-106908.z94TuJ.rst b/Misc/NEWS.d/next/Core and Builtins/2023-10-10-00-49-35.gh-issue-106908.z94TuJ.rst new file mode 100644 index 00000000000000..19a5bfaac8eca8 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2023-10-10-00-49-35.gh-issue-106908.z94TuJ.rst @@ -0,0 +1,2 @@ +Fix a reference leak when running with :envvar:`PYTHONUOPS` or :option:`-X +uops <-X>` enabled. From 1bbea3b474625f29c1492ae4d4eb4a9d7fada894 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Tue, 10 Oct 2023 00:56:04 -0700 Subject: [PATCH 3/3] fixup --- ...4TuJ.rst => 2023-10-10-00-49-35.gh-issue-104584.z94TuJ.rst} | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) rename Misc/NEWS.d/next/Core and Builtins/{2023-10-10-00-49-35.gh-issue-106908.z94TuJ.rst => 2023-10-10-00-49-35.gh-issue-104584.z94TuJ.rst} (67%) diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-10-10-00-49-35.gh-issue-106908.z94TuJ.rst b/Misc/NEWS.d/next/Core and Builtins/2023-10-10-00-49-35.gh-issue-104584.z94TuJ.rst similarity index 67% rename from Misc/NEWS.d/next/Core and Builtins/2023-10-10-00-49-35.gh-issue-106908.z94TuJ.rst rename to Misc/NEWS.d/next/Core and Builtins/2023-10-10-00-49-35.gh-issue-104584.z94TuJ.rst index 19a5bfaac8eca8..5164c73aad1de2 100644 --- a/Misc/NEWS.d/next/Core and Builtins/2023-10-10-00-49-35.gh-issue-106908.z94TuJ.rst +++ b/Misc/NEWS.d/next/Core and Builtins/2023-10-10-00-49-35.gh-issue-104584.z94TuJ.rst @@ -1,2 +1 @@ -Fix a reference leak when running with :envvar:`PYTHONUOPS` or :option:`-X -uops <-X>` enabled. +Fix a reference leak when running with :envvar:`PYTHONUOPS` or :option:`-X uops <-X>` enabled.