[issue44600] match/case statements trace incorrectly in 3.10.0b4

Brandt Bucher report at bugs.python.org
Thu Jul 15 14:47:39 EDT 2021


Brandt Bucher <brandtbucher at gmail.com> added the comment:

Thanks, that test framework looks good for this.

My initial hunch (just from looking at this) is that this has to do with how we handle cleanup after failed matches. Our "fail pop" blocks probably have whatever the last line number compiled was (which I think is always the last line of the preceding case block).

The fix *should* be as simple as calling "SET_LOC(c, whatever_the_last_pattern_was)" before compiling these blocks.

I have some new-ish contributors who might want to take this. As far as compiler issues go, this one seems pretty straightforward.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44600>
_______________________________________


More information about the Python-bugs-list mailing list