-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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-98686: Fix compiler warning for HAS_ARG
#99106
Conversation
brandtbucher
commented
Nov 4, 2022
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Issue: Quicken everything #98686
Python/ceval.c
Outdated
@@ -143,7 +143,7 @@ lltrace_instruction(_PyInterpreterFrame *frame, | |||
const char *opname = _PyOpcode_OpName[opcode]; | |||
assert(opname != NULL); | |||
int offset = (int)(next_instr - _PyCode_CODE(frame->f_code)); | |||
if (HAS_ARG(_PyOpcode_Deopt[opcode])) { | |||
if (HAVE_ARGUMENT <= _PyOpcode_Deopt[opcode]) { |
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.
HAVE_ARGUMENT isn't used directly anywhere else. I think casting and using HAS_ARG might be better.
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.
But we don't have to worry about things like pseudo-opcodes, right? This seems like exactly the sort of thing HAVE_ARGUMENT
is meant for...
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.
Kind of. HAVE_ARGUMENT was there before we had pseudo-opcodes, and HAS_ARG just compared with it. Now we have pseudo-opcodes, and if I saw HAVE_ARGUMENT in the code now my first thought would be that this is a bug (a place where we didn't update for pseudo-opcodes). So the trick is to make this not look like a bug.