Skip to content

Commit 12e85cf

Browse files
committed
Don't mess with END_FOR
1 parent 68077f1 commit 12e85cf

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

Python/bytecodes.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ dummy_func(
135135
res = NULL;
136136
}
137137

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

142140
inst(UNARY_NEGATIVE, (value -- res)) {
143141
res = PyNumber_Negative(value);

Python/generated_cases.c.h

+10-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/opcode_metadata.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
3838
case PUSH_NULL:
3939
return 0;
4040
case END_FOR:
41-
return 2;
41+
return 1+1;
4242
case UNARY_NEGATIVE:
4343
return 1;
4444
case UNARY_NOT:
@@ -390,7 +390,7 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
390390
case PUSH_NULL:
391391
return 1;
392392
case END_FOR:
393-
return 0;
393+
return 0+0;
394394
case UNARY_NEGATIVE:
395395
return 1;
396396
case UNARY_NOT:
@@ -735,7 +735,7 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = {
735735
[LOAD_CONST__LOAD_FAST] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IBIB },
736736
[POP_TOP] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },
737737
[PUSH_NULL] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },
738-
[END_FOR] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },
738+
[END_FOR] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IB },
739739
[UNARY_NEGATIVE] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },
740740
[UNARY_NOT] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },
741741
[UNARY_INVERT] = { DIR_NONE, DIR_NONE, DIR_NONE, true, INSTR_FMT_IX },

0 commit comments

Comments
 (0)