8000 Don't mess with END_FOR · python/cpython@dc507f4 · GitHub
[go: up one dir, main page]

Skip to content

Commit dc507f4

Browse files
committed
Don't mess with END_FOR
1 parent eec2fcc commit dc507f4

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
@@ -137,9 +137,7 @@ dummy_func(
137137
res = NULL;
138138
}
139139

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

144142
inst(UNARY_NEGATIVE, (value -- res)) {
145143
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)
0