[Python-Dev] no remaining issues blocking 2.5 release (original) (raw)

Neal Norwitz nnorwitz at gmail.com
Wed Aug 16 09:06:39 CEST 2006


On 8/15/06, Neil Schemenauer <nas at arctrix.com> wrote:

It would be nice if someone could bytecompile Lib using Tools/compiler/compile.py and then run the test suite. I'd do it myself but can't spare the time at the moment (I started but ran into what seems to be a gcc bug along the way).

Has this been done before?

This code causes python to segfault

def foo(S): all(x > 42 for x in S)

around Python/ceval.c 2167: x = (*v->ob_type->tp_iternext)(v);

tp_iternext is NULL

I added the changes below to Lib/compiler/pycodegen.py which are clearly wrong. It just crashes in a diff place. I think the changes to genxpr inner may be close to correct. The changes to _makeClosure and visitGenExpr are clearly wrong. I was just wondering how far it would go. There are a bunch of differences. Some are the bytecode optimizations or different ordering, but others are things dealing with co_names, co_varnames.

Hopefully someone has time to look into this. Otherwise, it will have to wait for 2.5.1

n

Index: Lib/compiler/pycodegen.py

--- Lib/compiler/pycodegen.py (revision 51305) +++ Lib/compiler/pycodegen.py (working copy) @@ -628,9 +628,9 @@ self.newBlock() self.emit('POP_TOP')

@@ -646,7 +646,7 @@ walk(node.code, gen) gen.finish() self.set_lineno(node)

@@ -655,6 +655,11 @@ def visitGenExprInner(self, node): self.set_lineno(node) # setup list

@@ -676,8 +681,12 @@ self.startBlock(cont) self.emit('POP_TOP') self.nextBlock(skip_one)



More information about the Python-Dev mailing list