Skip to content

Commit

Permalink
Treat COMPARE_OP_*_JUMP as superinstructions
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed Jun 17, 2022
1 parent 8e3071b commit 67c8382
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion specialist.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ def stderr(*args: object) -> None:

def is_superinstruction(instruction: dis.Instruction) -> bool:
"""Check if an instruction is a superinstruction."""
return "__" in instruction.opname
opname = instruction.opname
return "__" in opname or (
opname.startswith("COMPARE_OP_") and opname.endswith("_JUMP")
)


def score_instruction(
Expand Down

0 comments on commit 67c8382

Please sign in to comment.