gh-91625: Don't ignore extended args of adaptive opcodes (GH-91626)

This commit is contained in:
Dennis Sweeney 2022-04-17 14:04:29 -04:00 committed by GitHub
parent 7659681556
commit cec5d858f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 18 deletions

View file

@ -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()