Title: BoolOp in multiple assign causes VerifyError
Type: behaviour Severity: normal
Components: Versions: 2.5.1
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fwierzbicki Nosy List: fwierzbicki, pcannata
Priority: Keywords:

Created on 2009-12-30.03:49:46 by pcannata, last changed 2009-12-30.15:39:32 by fwierzbicki.

msg5396 (view) Author: Philip Cannata (pcannata) Date: 2009-12-30.03:49:45
>>> a=1 and b=2Value is Num
java.lang.VerifyError: (class: org/python/pycode/_pyx3, method: f$0 
signature: (Lorg/python/core/PyFrame;Lorg/python/core/ThreadState;)
Lorg/python/core/PyObject;) Inconsistent stack height 0 != 1
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors
        at java.lang.Class.getConstructor0(
        at java.lang.Class.getConstructor(
        at org.python.core.BytecodeLoader.makeCode
        at org.python.compiler.LegacyCompiler$LazyLegacyBundle.loadCode
        at org.python.core.CompilerFacade.compile
        at org.python.core.Py.compile_flags(
        at org.python.core.Py.compile_command_flags(
        at org.python.util.InteractiveInterpreter.runsource
        at org.python.util.InteractiveInterpreter.runsource
        at org.python.util.InteractiveConsole.push
        at org.python.util.InteractiveConsole.interact
        at org.python.util.jython.main(

java.lang.VerifyError: java.lang.VerifyError: (class: 
org/python/pycode/_pyx3, method: f$0 signature: 
Lorg/python/core/PyObject;) Inconsistent stack height 0 != 1
msg5397 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2009-12-30.13:07:13
yep, this does indeed crash us.  yuck.
msg5398 (view) Author: Philip Cannata (pcannata) Date: 2009-12-30.14:59:28
Hi Frank, I see you were at Sun until recently :(. I'm at Sun but I 
also teach a Programming Languages course at the University of Texas in 
Austin. I'm considering teaching the internals of Jython in my course 
but I'm just getting familiar with them myself. Would you mind 
answering a question?

In src/org/python/antlr/ast/ I'd like to see the values 
of "a" and "b" in the execution below.

>>> a, b = 1, 2
PHIL - Assign 2
Target is Tuple(elts=[Name, Name],ctx=Store,)
Value is Tuple(elts=[Num, Num],ctx=Load,)
>>> x=a+b
PHIL - Assign 2
Target is Name(id=x,ctx=Store,)
Value is BinOp(left=Name(id=a,ctx=Load,),op=Add,right=Name

I tried the following in the code:
    public Assign(Integer ttype, Token token, java.util.List<expr> 
targets, expr value) {
        super(ttype, token);
        System.out.println("PHIL - Assign 2");
        this.targets = targets;
        if (targets == null) {
            this.targets = new ArrayList<expr>();
        for(PythonTree t : this.targets) {
            System.out.println("Target is " + t.toStringTree());
        System.out.println("Value is " + value.toStringTree());
        this.value = value;

but toStringTree() doesn't give the values of the variables. Is there 
some way to get them inside of

I tried to respond to your email about the but but I got the following:
Subject: Failed issue tracker submission
To: Phil.Cannata@Sun.COM 

You are not a registered user.
msg5399 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2009-12-30.15:34:01
Hi Philip.  toStringTree has suffered some bit rot -- have you tried in the ast/ directory of a Jython checkout?  It will show the
AST pretty nicely.  The best place to ask questions is jython-users or
jython-dev for stuff about the actual development of Jython
msg5400 (view) Author: Frank Wierzbicki (fwierzbicki) Date: 2009-12-30.15:39:31
Fixed in r6958.  Thanks for reporting this!
Date User Action Args
2009-12-30 15:39:32fwierzbickisetstatus: open -> closed
resolution: accepted -> fixed
messages: + msg5400
2009-12-30 15:34:01fwierzbickisetmessages: + msg5399
2009-12-30 15:30:38fwierzbickisettitle: >>> a=1 and b=2 crashes interpreter -> BoolOp in multiple assign causes VerifyError
2009-12-30 14:59:29pcannatasetmessages: + msg5398
2009-12-30 13:07:14fwierzbickisetassignee: fwierzbicki
resolution: accepted
messages: + msg5397
nosy: + fwierzbicki
2009-12-30 03:49:46pcannatacreate