8000 gh-131998: Fix `NULL` dereference when using an unbound method descriptor in a specialized code path by ZeroIntensity · Pull Request #132000 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-131998: Fix NULL dereference when using an unbound method descriptor in a specialized code path #132000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 8, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add a test.
  • Loading branch information
ZeroIntensity committed Apr 2, 2025
commit 1914aca1332fa93a1f621c1e994b5044b2135a8c
13 changes: 13 additions & 0 deletions Lib/test/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,19 @@ def test_traceback_and_frame_types(self):
def test_capsule_type(self):
self.assertIsInstance(_datetime.datetime_CAPI, types.CapsuleType)

def test_gh131998(self):
# GH-131998: The specialized instruction would get tricked into dereferencing
# a bound "self" that didn't exist if subsequently called unbound.
def call(part):
part.pop()


try:
call(["a"])
call(list)
except:
pass


class UnionTests(unittest.TestCase):

Expand Down
0