Alexander Belopolsky added the comment: Attached patch adds test_elim_unreachable() unit test. Last two assertions should fail with unpatched python.
I am still trying to convince myself that the transformation are correct. > I propose that codestr[] array is made one byte > longer and RETURN_VALUE opcode wrote in that extra byte. I don't think that will be correct. Did you consider the following comment? /* Verify that RETURN_VALUE terminates the codestring. This allows the various transformation patterns to look ahead several instructions without additional checks to make sure they are not looking beyond the end of the code string. */ if (codestr[codelen-1] != RETURN_VALUE) goto exitUnchanged; Added file: http://bugs.python.org/file9555/test_peepholer.diff __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1394> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com