[New-bugs-announce] [issue2472] Fixed block ordering code in compiler.pyassem

Antoine Pitrou report at bugs.python.org
Mon Mar 24 13:09:41 CET 2008


New submission from Antoine Pitrou <pitrou at free.fr>:

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.

----------
components: Library (Lib)
files: fixcompiler.patch
keywords: patch
messages: 64410
nosy: pitrou
severity: normal
status: open
title: Fixed block ordering code in compiler.pyassem
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file9838/fixcompiler.patch

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2472>
__________________________________


More information about the New-bugs-announce mailing list