summaryrefslogtreecommitdiffstats
path: root/Python/flowgraph.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-09-27 12:24:33 (GMT)
committerGitHub <noreply@github.com>2023-09-27 12:24:33 (GMT)
commitea285ad8b69c6ed91fe79edb3b0ea4d9cd6e6011 (patch)
tree6fcfc83e52e2ce3642ce94dae7dbba739dad78c4 /Python/flowgraph.c
parentb89ed9df39851348fbb1552294644f99f6b17d2c (diff)
downloadcpython-ea285ad8b69c6ed91fe79edb3b0ea4d9cd6e6011.zip
cpython-ea285ad8b69c6ed91fe79edb3b0ea4d9cd6e6011.tar.gz
cpython-ea285ad8b69c6ed91fe79edb3b0ea4d9cd6e6011.tar.bz2
gh-109923: set line number on the POP_TOP that follows a RETURN_GENERATOR (#109924)
Diffstat (limited to 'Python/flowgraph.c')
-rw-r--r--Python/flowgraph.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/flowgraph.c b/Python/flowgraph.c
index 9c24264..9fe387c 100644
--- a/Python/flowgraph.c
+++ b/Python/flowgraph.c
@@ -2468,17 +2468,19 @@ insert_prefix_instructions(_PyCompile_CodeUnitMetadata *umd, basicblock *entrybl
* of 0. This is because RETURN_GENERATOR pushes an element
* with _PyFrame_StackPush before switching stacks.
*/
+
+ location loc = LOCATION(umd->u_firstlineno, umd->u_firstlineno, -1, -1);
cfg_instr make_gen = {
.i_opcode = RETURN_GENERATOR,
.i_oparg = 0,
- .i_loc = LOCATION(umd->u_firstlineno, umd->u_firstlineno, -1, -1),
+ .i_loc = loc,
.i_target = NULL,
};
RETURN_IF_ERROR(basicblock_insert_instruction(entryblock, 0, &make_gen));
cfg_instr pop_top = {
.i_opcode = POP_TOP,
.i_oparg = 0,
- .i_loc = NO_LOCATION,
+ .i_loc = loc,
.i_target = NULL,
};
RETURN_IF_ERROR(basicblock_insert_instruction(entryblock, 1, &pop_top));