Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4205484

finally error - CompilerError: stack depth error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.6
    • tools
    • generic
    • generic



      Name: diC59631 Date: 01/25/99


      I have the following small class:

      public class FinError {

      private long myMeth() {

      try {
      return 1L;
      }
      catch(StringIndexOutOfBoundsException se) {
      System.out.println(se.toString());
      }
      finally {return 0L; }
      }
      }

      If I try to compile it with javac on a DEC Alpha station with OSF,
      , the following messages appear:

      (pax10f)$ java -version
      java version "1.1.6-2"
      (pax10f)$ javac FinError.java
      ERROR: sun.tools.java.CompilerError: stack depth error 1/0: $7:
      -- listing --
      $2:
      5: try 273090
      5: try 273062
      6: lconst_1 1
      6: pop
      6: goto $7:
      $9:
      $10:
      8: astore 1
      9: getstatic java.io.PrintStream out
      9: aload 1
      9: invokevirtual java.lang.String toString()
      9: invokevirtual void println(java.lang.String)
      5: goto $7:
      $4:
      $5:
      5: pop
      $7:
      11: lconst_0 0
      11: lreturn
      sun.tools.java.CompilerError: stack depth error 1/0: $7:
              at sun.tools.asm.Assembler.balance(Compiled Code)
              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(Compiled Code)
      error: An error has occurred in the compiler; please file a bug report (http://j
      ava.sun.com/cgi-bin/bugreport.cgi).
      1 error

      The same happens on a PC with WindowsNT 4.0:

      M:\javadir\nl14>java -version
      java version "1.1_Final"
      M:\javadir\nl14>javac FinError.java
      ERROR: sun.tools.java.CompilerError: stack depth error 1/0: $7:
      -- listing --
      $2:
      5: try 1839961
      5: try 1839975
      6: lconst_1 1
      6: pop
      6: goto $7:
      $9:
      $10:
      8: astore 1
      9: getstatic java.io.PrintStream out
      9: aload 1
      9: invokevirtual java.lang.String toString()
      9: invokevirtual void println(java.lang.String)
      5: goto $7:
      $4:
      $5:
      5: pop
      $7:
      11: lconst_0 0
      11: lreturn
      sun.tools.java.CompilerError: stack depth error 1/0: $7:
              at sun.tools.asm.Assembler.balance(Assembler.java:258)
              at sun.tools.asm.Assembler.balance(Assembler.java:288)
              at sun.tools.asm.Assembler.write(Assembler.java:380)
              at sun.tools.javac.SourceClass.compileClass(SourceClass.java:1353)
              at sun.tools.javac.SourceClass.compile(SourceClass.java:1093)
              at sun.tools.javac.Main.compile(Main.java:319)
              at sun.tools.javac.Main.main(Main.java:456)
      error: An error has occurred in the compiler; please file a bug report (java-bug
      ###@###.###).
      1 error
      (Review ID: 53112)
      ======================================================================

            wmaddoxsunw William Maddox (Inactive)
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: