Name: diC59631 Date: 12/01/98
1. compile the following using javac jdk1.1.7:
public class Test{
Object lock=new Object();
private boolean pause;
public void execute(){
Thread thr=new Thread(){
public void run(){
boolean trip=true;
do{
synchronized(lock){
if(pause){
trip=pause=false;
}
}
}while(trip);
}
};
}
}
================================================
You will get:
ERROR: sun.tools.java.CompilerError: stack under flow: 16: istore 1 = -1
-- listing --
$8:
$9:
0: aload 0
0: getfield softlynks.scuba.Test this$0
13: invokevirtual boolean setState()
13: istore 1
0: aload 0
0: getfield softlynks.scuba.Test this$0
14: getfield java.lang.Object lock
14: astore 2
14: aload 2
14: monitorenter
14: try 1882716
0: aload 0
0: getfield softlynks.scuba.Test this$0
15: invokestatic boolean access$0(softlynks.scuba.Test)
15: ifeq $13:
0: aload 0
0: getfield softlynks.scuba.Test this$0
16: iconst_0 0
16: invokestatic void access$1(softlynks.scuba.Test, boolean)
16: istore 1
$13:
14: aload 2
14: monitorexit
14: goto $11:
$14:
14: aload 2
14: monitorexit
14: athrow
$11:
19: iload 1
19: ifne $9:
10: return
sun.tools.java.CompilerError: stack under flow: 16: istore 1 = -1
at sun.tools.asm.Assembler.balance(Compiled Code)
at sun.tools.asm.Assembler.write(Compiled Code)
at sun.tools.javac.SourceClass.compileClass(Compiled Code)
at sun.tools.javac.SourceClass.compile(Compiled Code)
at sun.tools.javac.Main.compile(Compiled Code)
at sun.tools.javac.Main.main(Main.java:465)
error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
1 error
(Review ID: 43519)
======================================================================
- duplicates
-
JDK-4098316 Stack underflow on inner class chained assignments
-
- Closed
-