]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-104614: Make Sure ob_type is Always Set Correctly by PyType_Ready() (gh-105122)
authorEric Snow <ericsnowcurrently@gmail.com>
Thu, 1 Jun 2023 22:28:31 +0000 (16:28 -0600)
committerGitHub <noreply@github.com>
Thu, 1 Jun 2023 22:28:31 +0000 (22:28 +0000)
commit146939306adcff706ebddb047f7470d148125cdf
tree7ba1a0832da33fff49813d51dee801e54efd9fce
parent3698fda06eefb3c01e78c4c07f46fcdd0559e0f6
gh-104614: Make Sure ob_type is Always Set Correctly by PyType_Ready() (gh-105122)

When I added the relevant condition to type_ready_set_bases() in gh-103912, I had missed that the function also sets tp_base and ob_type (if necessary).  That led to problems for third-party static types.

We fix that here, by making those extra operations distinct and by adjusting the condition to be more specific.
Lib/test/test_capi/test_misc.py
Modules/_testcapimodule.c
Objects/typeobject.c
Tools/c-analyzer/cpython/ignored.tsv