Title: ArrayIndexOutOfBounds in compiler due to list comprehension
Type: crash Severity: normal
Components: Core Versions: Jython 2.7, Jython 2.5
Status: open Resolution: accepted
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: fwierzbicki, int3, larsga, santa4nt, zyasoft
Priority: normal Keywords:

Created on 2012-06-07.18:57:46 by larsga, last changed 2014-05-22.01:34:25 by zyasoft.

msg7185 (view) Author: Lars Marius Garshol (larsga) Date: 2012-06-07.18:57:45
The following expression:

[z for (idcol, sql(prev_id)) in a]

causes the compiler to crash with the following traceback, regardless of whether it's entered in the interpreter or loaded in a .py file.

java.lang.ArrayIndexOutOfBoundsException: 1
	at org.python.objectweb.asm.Frame.a(Unknown Source)
	at org.python.objectweb.asm.Frame.a(Unknown Source)
	at org.python.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
	at org.python.compiler.Code.visitMaxs(
	at org.python.compiler.ClassFile.endMethods(
	at org.python.compiler.ClassFile.write(
	at org.python.compiler.Module.write(
	at org.python.compiler.Module.compile(
	at org.python.compiler.Module.compile(
	at org.python.compiler.LegacyCompiler$LazyLegacyBundle.ostream(
	at org.python.compiler.LegacyCompiler$LazyLegacyBundle.saveCode(
	at org.python.core.CompilerFacade.compile(
	at org.python.core.Py.compile_flags(
	at org.python.core.Py.compile_command_flags(
msg7703 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2013-02-19.21:37:57
Confirmed. It *is* an invalid expression for CPython 2.7, but it shouldn't cause a crash (just a parser error).
msg8544 (view) Author: Jim Baker (zyasoft) Date: 2014-05-22.01:34:25
Target beta 4


$ python
Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> [z for (idcol, sql(prev_id)) in a]
  File "<stdin>", line 1
SyntaxError: can't assign to function call

Jython 2.7 has the same issue reported by the OP
Date User Action Args
2014-05-22 01:34:25zyasoftsetresolution: accepted
messages: + msg8544
nosy: + zyasoft
2013-11-01 23:55:25santa4ntsetnosy: + santa4nt
2013-10-27 07:26:55jeff.allensettitle: NewInterface -> ArrayIndexOutOfBounds in compiler due to list comprehension
2013-10-25 21:29:45jeff.allensetnosy: - overratedbarrel, tiresomedaybook
2013-10-25 21:28:21jeff.allensetfiles: - sa16.html
2013-10-25 21:28:17jeff.allensetfiles: - test1.html
2013-10-25 21:28:13jeff.allensetmessages: - msg8089
2013-10-25 21:28:03jeff.allensetmessages: - msg8085
2013-08-26 15:18:09tiresomedaybooksetfiles: + sa16.html
nosy: + tiresomedaybook
messages: + msg8089
title: Interface -> NewInterface
2013-08-22 15:27:41overratedbarrelsetfiles: + test1.html
nosy: + overratedbarrel
messages: + msg8085
title: ArrayIndexOutOfBounds in compiler due to list comprehension -> Interface
2013-02-19 21:37:57fwierzbickisetpriority: normal
assignee: fwierzbicki
versions: + Jython 2.5, Jython 2.7, - 2.5.3b1
messages: + msg7703
nosy: + fwierzbicki
2012-06-18 07:51:27int3setnosy: + int3
2012-06-07 18:59:02larsgasettitle: ArrayIndexOutOfBounds -> ArrayIndexOutOfBounds in compiler due to list comprehension
2012-06-07 18:57:46larsgacreate