summaryrefslogtreecommitdiffstats
path: root/Python/codegen.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2025-01-06 17:54:47 (GMT)
committerGitHub <noreply@github.com>2025-01-06 17:54:47 (GMT)
commitf826beca0cedb8e4b92896544c75fd0d9dcb0446 (patch)
tree87630b6e28e141a0e687e04d2f66d8e4cde21b99 /Python/codegen.c
parentb9c693dcca01537eee1ef716ffebc632be37594b (diff)
downloadcpython-f826beca0cedb8e4b92896544c75fd0d9dcb0446.zip
cpython-f826beca0cedb8e4b92896544c75fd0d9dcb0446.tar.gz
cpython-f826beca0cedb8e4b92896544c75fd0d9dcb0446.tar.bz2
GH-128375: Better instrument for `FOR_ITER` (GH-128445)
Diffstat (limited to 'Python/codegen.c')
-rw-r--r--Python/codegen.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/codegen.c b/Python/codegen.c
index 7432415..14f9f5a 100644
--- a/Python/codegen.c
+++ b/Python/codegen.c
@@ -409,7 +409,7 @@ codegen_addop_j(instr_sequence *seq, location loc,
if (_PyInstructionSequence_Addop(seq, opcode, target.id, loc) != SUCCESS) {
return ERROR;
}
- if (IS_CONDITIONAL_JUMP_OPCODE(opcode) || opcode == FOR_ITER) {
+ if (IS_CONDITIONAL_JUMP_OPCODE(opcode)) {
return _PyInstructionSequence_Addop(seq, NOT_TAKEN, 0, NO_LOCATION);
}
return SUCCESS;
@@ -2018,7 +2018,7 @@ codegen_for(compiler *c, stmt_ty s)
* but a non-generator will jump to a later instruction.
*/
ADDOP(c, NO_LOCATION, END_FOR);
- ADDOP(c, NO_LOCATION, POP_TOP);
+ ADDOP(c, NO_LOCATION, POP_ITER);
_PyCompile_PopFBlock(c, COMPILE_FBLOCK_FOR_LOOP, start);
@@ -4283,7 +4283,7 @@ codegen_sync_comprehension_generator(compiler *c, location loc,
* but a non-generator will jump to a later instruction.
*/
ADDOP(c, NO_LOCATION, END_FOR);
- ADDOP(c, NO_LOCATION, POP_TOP);
+ ADDOP(c, NO_LOCATION, POP_ITER);
}
return SUCCESS;