This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Fixed block ordering code in compiler.pyassem
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: nascheme Nosy List: nascheme, pitrou
Priority: normal Keywords: patch

Created on 2008-03-24 12:09 by pitrou, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fixcompiler.patch pitrou, 2008-03-24 12:11
Messages (5)
msg64410 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-03-24 12:09
This is a rewrite of the block ordering code in the compiler package
(specifically, the flowgraph part). The previous code was littered with
self-admitted "hacks", "fixups" and "XXX" :-) They are all removed and
replaced with a clean ``order_blocks`` function which does the right
thing from the start.

The patch also replaces a wrong startBlock() with a nextBlock() in
compiler.pycodegen (startBlock can only be used when the previous block
does an unconditional transfer to another one, otherwise the two
adjacent blocks may not be emitted in order).

I've run test_compiler a couple of times, and tested execution of
several functions. They all run fine. Unless someone has specific
reasons to reject the patch, I'd recommend applying it even if not many
people use the compiler package :) I needed the fixes for my work on #2459.
msg64412 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-03-24 12:24
By enabling TEST_ALL I've just run
``test_compiler.CompilerTest.testCompileLibrary`` against the whole
stdlib, and there were no errors. It's a good sign :-)
msg64473 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-03-25 10:51
Neal, I don't have sufficient permissions to assign bugs to anybody, but
here you are in the nosy list. :)
msg81300 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2009-02-06 21:11
Thanks Antoine.  For some reason I don't think I ever got an email about
this issue.  I did some further cleanups and optimizations.  Committed
as SVN rev 69373.

Lib/compiler is still in need of some fixing since it doesn't handle
decorators and some other new language features.  I'll try to keep at it.
msg81312 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2009-02-06 22:26
> Thanks Antoine.  For some reason I don't think I ever got an email about
> this issue.  I did some further cleanups and optimizations.  Committed
> as SVN rev 69373.

Thanks! If I knew you hadn't received any notification I would have
tried to ping you... I'm glad this is finally accepted :)
History
Date User Action Args
2022-04-11 14:56:32adminsetgithub: 46724
2009-02-06 22:26:42pitrousetmessages: + msg81312
2009-02-06 21:11:25naschemesetstatus: open -> closed
assignee: nascheme
messages: + msg81300
resolution: accepted
stage: resolved
2008-03-25 10:51:11pitrousetnosy: + nascheme
messages: + msg64473
2008-03-24 12:24:31pitrousetmessages: + msg64412
2008-03-24 12:11:31pitrousetfiles: + fixcompiler.patch
2008-03-24 12:11:21pitrousetfiles: - fixcompiler.patch
2008-03-24 12:09:38pitroucreate