Skip to content

Comments

[3.8] bpo-41909: Enable previously disabled recursion checks. (GH-22536)#22551

Merged
serhiy-storchaka merged 1 commit intopython:3.8from
serhiy-storchaka:backport-9ece9cd-3.8
Oct 4, 2020
Merged

[3.8] bpo-41909: Enable previously disabled recursion checks. (GH-22536)#22551
serhiy-storchaka merged 1 commit intopython:3.8from
serhiy-storchaka:backport-9ece9cd-3.8

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 4, 2020

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 9ece9cd)

Co-authored-by: Serhiy Storchaka [email protected]

https://bugs.python.org/issue41909

…GH-22536)

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 9ece9cd)

Co-authored-by: Serhiy Storchaka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants