[issue16619] LOAD_GLOBAL used to load `None` under certain circumstances

Terry J. Reedy report at bugs.python.org
Wed Dec 5 23:39:06 CET 2012


Terry J. Reedy added the comment:

(2.6 is security fix only)

Stripping truly dead code after return is really tricky in general because
a) it might be in a conditional block, and 
b) unreachable yield and assignment can affect compilation.
Assignments that make names local are detected on a first pass, but I do not know about yield. Anyway, I believe the policy has been to not do it.

The final patch will need a cpython-only test based on g(x), with dead code.

Possibly intersecting issues are proposals to change where optimization is done and, for testing, to add a generator to dis so its output can be directly captured and analyzed instead of having to redirect, capture, and parse stdout.

----------
nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, terry.reedy
stage:  -> patch review
type:  -> behavior
versions:  -Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16619>
_______________________________________


More information about the Python-bugs-list mailing list