Thomas Wouters <tho...@python.org> added the comment:

As mentioned in the PR (GH-15970), I don't think we should fix this bug. We 
can, but it involves replacing PyCode_Optimize() (which is public but 
undocumented, with confusing refcount effects) with a stub, and very careful 
surgery on the code of the peephole optimizer. I tried three different ways and 
I keep running into unexpected side-effects of my changes, because of how the 
optimizer is called by the compiler.

It is the case that other changes in 3.8 make this bug more apparent, but it's 
always been around (at least since lnotab was introduced). At this point I 
think the best thing to do is to document that lnotab can have invalid bytecode 
offsets, and then reconsider serious refactoring and redesign of the peephole 
optimizer if it's going to be kept around in 3.9. (Right now there's talk about 
replacing it with a more sensible CFG-based optimizer.)

----------
keywords:  -patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38115>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to