-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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-100982: Add COMPARE_AND_BRANCH
instruction
#100983
GH-100982: Add COMPARE_AND_BRANCH
instruction
#100983
Conversation
markshannon
commented
Jan 12, 2023
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Issue: Specialization of some instructions does not conform to PEP 659, and prevents PEP 669 #100982
@@ -189,7 +189,8 @@ def pseudo_op(name, op, real_ops): | |||
def_op('DELETE_DEREF', 139) | |||
hasfree.append(139) | |||
jrel_op('JUMP_BACKWARD', 140) # Number of words to skip (backwards) | |||
|
|||
def_op('COMPARE_AND_BRANCH', 141) # Comparison and jump | |||
hascompare.append(141) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This opcode needs to be in hasjrel as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that dis
sees COMPARE_AND_BRANCH
, then POP_JUMP_IF_
. The POP_JUMP_IF_
is where we jump from.
So marking COMPARE_AND_BRANCH
as a jump confuses dis, it thinks the operator is a jump offset. COMPARE_AND_BRANCH
is effectively a superinstruction.
I could special case COMPARE_AND_BRANCH
in dis, but I think it might be better to wait for proper support for longer instructions.