mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-123044: Give the POP_TOP
after a case test a location in the body, not the pattern. (GH-130627)
This commit is contained in:
parent
91d6db7ee0
commit
be046ee6e0
6 changed files with 52 additions and 6 deletions
|
@ -6124,7 +6124,8 @@ codegen_match_inner(compiler *c, stmt_ty s, pattern_context *pc)
|
|||
}
|
||||
// Success! Pop the subject off, we're done with it:
|
||||
if (i != cases - has_default - 1) {
|
||||
ADDOP(c, LOC(m->pattern), POP_TOP);
|
||||
/* Use the next location to give better locations for branch events */
|
||||
ADDOP(c, NEXT_LOCATION, POP_TOP);
|
||||
}
|
||||
VISIT_SEQ(c, stmt, m->body);
|
||||
ADDOP_JUMP(c, NO_LOCATION, JUMP, end);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue