Title: List Comprehension in finally throws NPE
Type: Severity: major
Components: Core Versions: 2.2.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: fwierzbicki
Priority: Keywords:

Created on 2008-06-06.16:34:36 by fwierzbicki, last changed 2008-06-06.18:42:03 by fwierzbicki.

msg3231 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-06-06.16:34:35
So the following fails in all versions of Jython 2.2 and on:

def foo():
      [f for f in (1,2)]

The reason this fails, is that ListComps are assigned a name in
ScopesCompiler and CodeCompiler based on a counter.  The reason this
fails is that finally blocks are inlined, and can thus be repeated
within the bytecodes.  This repetition causes the counter to increment
too many times in CodeCompiler, causing mismatches between the names
in ScopesCompiler and CodeCompiler.  What I think is necessary here is
to come up with a naming convention that doesn't involve a counter.  I
propose we use the line and column info for the ListComp node, so we
make the following change
msg3232 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2008-06-06.18:41:57
Fixed in 2.2 maint branch, trunk, and asm branch.
Date User Action Args
2008-06-06 18:42:03fwierzbickisetstatus: open -> closed
resolution: fixed
messages: + msg3232
2008-06-06 16:34:54fwierzbickisetassignee: fwierzbicki
2008-06-06 16:34:36fwierzbickicreate