mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-128891: add specialized opcodes to opcode.opname (#128892)
This commit is contained in:
parent
256d6d2131
commit
5eee2fe2b0
4 changed files with 15 additions and 4 deletions
|
@ -999,12 +999,14 @@ class DisTests(DisTestBase):
|
|||
def test_widths(self):
|
||||
long_opcodes = set(['JUMP_BACKWARD_NO_INTERRUPT',
|
||||
'INSTRUMENTED_CALL_FUNCTION_EX'])
|
||||
for opcode, opname in enumerate(dis.opname):
|
||||
for op, opname in enumerate(dis.opname):
|
||||
if opname in long_opcodes or opname.startswith("INSTRUMENTED"):
|
||||
continue
|
||||
if opname in opcode._specialized_opmap:
|
||||
continue
|
||||
with self.subTest(opname=opname):
|
||||
width = dis._OPNAME_WIDTH
|
||||
if opcode in dis.hasarg:
|
||||
if op in dis.hasarg:
|
||||
width += 1 + dis._OPARG_WIDTH
|
||||
self.assertLessEqual(len(opname), width)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue