Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Don't mess with END_FOR
  • Loading branch information
gvanrossum committed Mar 13, 2023
commit 12e85cfc6a114d40d04528c6305efb78652ef12c
4 changes: 1 addition & 3 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ dummy_func(
res = NULL;
}

inst(END_FOR, (second, first --)) {
DECREF_INPUTS();
}
macro(END_FOR) = POP_TOP + POP_TOP;

inst(UNARY_NEGATIVE, (value -- res)) {
res = PyNumber_Negative(value);
Expand Down
14 changes: 10 additions & 4 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Python/opcode_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
case PUSH_NULL:
return 0;
case END_FOR:
return 2;
return 1+1;
case UNARY_NEGATIVE:
return 1;
case UNARY_NOT:
Expand Down Expand Up @@ -390,7 +390,7 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
case PUSH_NULL:
return 1;
case END_FOR:
return 0;
return 0+0;
case UNARY_NEGATIVE:
return 1;
case UNARY_NOT:
Expand Down Expand Up @@ -735,7 +735,7 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = {
[LOAD_CONST__LOAD_FAST] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IBIB },
[POP_TOP] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },
[PUSH_NULL] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },
[END_FOR] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },
[END_FOR] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IB },
[UNARY_NEGATIVE] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },
[UNARY_NOT] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },
[UNARY_INVERT] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },
Expand Down