[3.12] gh-120722: Set position on RETURN_VALUE in lambda (GH-120724) (#120739)

(cherry picked from commit d8f27cb114)
This commit is contained in:
Jelle Zijlstra 2024-06-19 06:19:39 -07:00 committed by GitHub
parent cde976d85c
commit d62cbba235
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 2 deletions

View file

@ -2966,7 +2966,7 @@ compiler_lambda(struct compiler *c, expr_ty e)
co = optimize_and_assemble(c, 0);
}
else {
location loc = LOCATION(e->lineno, e->lineno, 0, 0);
location loc = LOC(e->v.Lambda.body);
ADDOP_IN_SCOPE(c, loc, RETURN_VALUE);
co = optimize_and_assemble(c, 1);
}