]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.9] bpo-41909: Enable previously disabled recursion checks. (GH-22536) (GH-22550)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 4 Oct 2020 22:27:38 +0000 (01:27 +0300)
committerGitHub <noreply@github.com>
Sun, 4 Oct 2020 22:27:38 +0000 (01:27 +0300)
commit7aa22ba923509af1dbf115c090964f503c84ca8d
tree27a570eb3dcdf44352df06ff0dbfb0f6eb694fd8
parentf3a6b7fc0b46afbe5d4d450b94a9d077e50b15d5
[3.9] bpo-41909: Enable previously disabled recursion checks. (GH-22536) (GH-22550)

Enable recursion checks which were disabled when get __bases__ of
non-type objects in issubclass() and isinstance() and when intern
strings. It fixes a stack overflow when getting __bases__ leads
to infinite recursion.

Originally recursion checks was disabled for PyDict_GetItem() which
silences all errors including the one raised in case of detected
recursion and can return incorrect result. But now the code uses
PyDict_GetItemWithError() and PyDict_SetDefault() instead.
(cherry picked from commit 9ece9cd65cdeb0a1f6e60475bbd0219161c348ac)
Lib/test/test_isinstance.py
Misc/NEWS.d/next/Core and Builtins/2020-10-04-10-55-12.bpo-41909.BqHPcm.rst [new file with mode: 0644]
Objects/abstract.c
Objects/unicodeobject.c