summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2024-08-28 16:11:52 (GMT)
committerGitHub <noreply@github.com>2024-08-28 16:11:52 (GMT)
commit61bef6245c4a32bf430d684ede8603f423d63284 (patch)
treedbd4df2f696e2f7c1c576ddd63ec8440c5b82cf2 /Python
parent40fff90ae3d46843bb9d27c6a53ef61c861a3bb4 (diff)
downloadcpython-61bef6245c4a32bf430d684ede8603f423d63284.zip
cpython-61bef6245c4a32bf430d684ede8603f423d63284.tar.gz
cpython-61bef6245c4a32bf430d684ede8603f423d63284.tar.bz2
gh-123142: fix too wide source location of GET_ITER/GET_AITER (#123420)
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 3464723..3d6bc7e 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2990,7 +2990,7 @@ codegen_async_for(struct compiler *c, stmt_ty s)
NEW_JUMP_TARGET_LABEL(c, end);
VISIT(c, expr, s->v.AsyncFor.iter);
- ADDOP(c, loc, GET_AITER);
+ ADDOP(c, LOC(s->v.AsyncFor.iter), GET_AITER);
USE_LABEL(c, start);
RETURN_IF_ERROR(compiler_push_fblock(c, loc, FOR_LOOP, start, end, NULL));
@@ -5284,7 +5284,7 @@ codegen_async_comprehension_generator(struct compiler *c, location loc,
else {
/* Sub-iter - calculate on the fly */
VISIT(c, expr, gen->iter);
- ADDOP(c, loc, GET_AITER);
+ ADDOP(c, LOC(gen->iter), GET_AITER);
}
}
@@ -5618,15 +5618,14 @@ pop_inlined_comprehension_state(struct compiler *c, location loc,
}
static inline int
-codegen_comprehension_iter(struct compiler *c, location loc,
- comprehension_ty comp)
+codegen_comprehension_iter(struct compiler *c, comprehension_ty comp)
{
VISIT(c, expr, comp->iter);
if (comp->is_async) {
- ADDOP(c, loc, GET_AITER);
+ ADDOP(c, LOC(comp->iter), GET_AITER);
}
else {
- ADDOP(c, loc, GET_ITER);
+ ADDOP(c, LOC(comp->iter), GET_ITER);
}
return SUCCESS;
}
@@ -5654,7 +5653,7 @@ codegen_comprehension(struct compiler *c, expr_ty e, int type,
outermost = (comprehension_ty) asdl_seq_GET(generators, 0);
if (is_inlined) {
- if (codegen_comprehension_iter(c, loc, outermost)) {
+ if (codegen_comprehension_iter(c, outermost)) {
goto error;
}
if (push_inlined_comprehension_state(c, loc, entry, &inline_state)) {
@@ -5736,7 +5735,7 @@ codegen_comprehension(struct compiler *c, expr_ty e, int type,
}
Py_CLEAR(co);
- if (codegen_comprehension_iter(c, loc, outermost)) {
+ if (codegen_comprehension_iter(c, outermost)) {
goto error;
}