mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-91625: Don't ignore extended args of adaptive opcodes (GH-91626)
This commit is contained in:
parent
7659681556
commit
cec5d858f5
5 changed files with 66 additions and 18 deletions
|
@ -151,5 +151,21 @@ def load_tests(loader, tests, pattern):
|
|||
return tests
|
||||
|
||||
|
||||
class TestCornerCases(unittest.TestCase):
|
||||
def test_extended_oparg_not_ignored(self):
|
||||
# https://github.com/python/cpython/issues/91625
|
||||
target = "(" + "y,"*400 + ")"
|
||||
code = f"""def unpack_400(x):
|
||||
{target} = x
|
||||
return y
|
||||
"""
|
||||
ns = {}
|
||||
exec(code, ns)
|
||||
unpack_400 = ns["unpack_400"]
|
||||
# Warm up the the function for quickening (PEP 659)
|
||||
for _ in range(30):
|
||||
y = unpack_400(range(400))
|
||||
self.assertEqual(y, 399)
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue