]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-115999: Specialize `CALL_KW` in free-threaded builds (#127713)
authormpage <mpage@meta.com>
Wed, 11 Dec 2024 23:18:22 +0000 (15:18 -0800)
committerGitHub <noreply@github.com>
Wed, 11 Dec 2024 23:18:22 +0000 (15:18 -0800)
commitc84928ed6de105696be24859e03f3ab27e11daf6
treec533074edffdb8ae55dfa197ce8d63417f28949a
parente8f4e272cc828f2b79fa17fc6b9786bdddab7ce4
gh-115999: Specialize `CALL_KW` in free-threaded builds (#127713)

* Enable specialization of CALL_KW

* Fix bug pushing frame in _PY_FRAME_KW

`_PY_FRAME_KW` pushes a pointer to the new frame onto the stack for
consumption by the next uop. When pushing the frame fails, we do not
want to push the result, `NULL`, to the stack because it is not
a valid stackref. This works in the default build because `PyStackRef_NULL`
 and `NULL` are the same value, so the `PyStackRef_XCLOSE()` in the error
handler ignores it. In the free-threaded build the values are not the same;
`PyStackRef_XCLOSE()` will attempt to decref a null pointer.
Python/bytecodes.c
Python/executor_cases.c.h
Python/generated_cases.c.h
Python/specialize.c