[Python-bugs-list] [ python-Bugs-406049 ] crash on nested listcomps

nobody nobody@sourceforge.net
Mon, 05 Mar 2001 10:36:24 -0800


Bugs #406049, was updated on 2001-03-05 08:47
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=406049&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Priority: 5
Submitted By: David Goodger
Assigned to: Nobody/Anonymous
Summary: crash on nested listcomps

Initial Comment:
(if you need to contact me: dgoodger@atsautomation.com)

I got an aborted interpreter under both QNX 4.25 and 
Windows NT 4.0:

Python 2.1b1 (#2, Mar 05 2001, 11:19:23) [C] on qnxJ
Type "copyright", "credits" or "license" for more 
information.
>>> l=[[[0,0,0] for i in range(3)] for j in range(3)]
Fatal Python error: unknown scope for _[2] in ?(0) in 
<stdin>
symbols: {'i': 2, 'l': 2, 'j': 2, 'range': 8, '_[1]': 
2}
locals: {'l': 1, 'j': 2, '_[1]': 3, 'i': 0}
globals: {'range': 1}

%1 - 32637 Abort                python


----------------------------------------------------------------------

Comment By: Michael Hudson
Date: 2001-03-05 10:36

Message:
Logged In: YES 
user_id=6656

tee hee.  fun one.

see patch #406076 for a fix & test case.  not sure the fix
is exactly what's wanted though.  the problem is that
--st->st_tmpname is called before symtable_node is called on
the first node in the listcomp. this patch gets rid of the
decrement and resets st_tmpname in symtable_enter_scope.

and doesn't pass make test.  hang on...

I want to rewrite Python/compile.c in OCaml one of these days...

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=406049&group_id=5470