-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
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
gh-131998: Fix NULL
dereference when using an unbound method descriptor in a specialized code path
#132000
Changes from 4 commits
345ad57
1914aca
5101034
2233afe
538c83b
04b61df
cd12c28
f73dd59
a2a07ea
aefcf8a
0eb6933
d1d5c0a
0261714
99037ae
d87de41
363acec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
run_with_locale, cpython_only, no_rerun, | ||
MISSING_C_DOCSTRINGS, | ||
) | ||
from test.support.script_helper import assert_python_ok | ||
import collections.abc | ||
from collections import namedtuple, UserDict | ||
import copy | ||
|
@@ -646,6 +647,22 @@ 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. | ||
code = """if True: | ||
import glob | ||
|
||
def call(part): | ||
ZeroIntensity marked this conversation as resolved.
Show resolved
Hide resolved
|
||
part.pop() | ||
|
||
try: | ||
call(['a']) | ||
call(list) | ||
except: | ||
pass | ||
ZeroIntensity marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
""" | ||
assert_python_ok("-c", code) | ||
|
||
|
||
class UnionTests(unittest.TestCase): | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Fix a crash when using an unbound method :term:`descriptor` object in a | ||
function where a bound method descriptor was used. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.