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

CompilerError occurres while compiling "return <long>" in "finally"

XMLWordPrintable

    • sparc
    • solaris_2.5.1



      Name: dkC59003 Date: 11/06/97



      Compilation of the following source file results in the compiler crash
      (reproduced for JDK 1.1.5F and JDK 1.2S):

      -----------------------------------------
      public class stmt09904 {
      static long run() {
      try {
      return 1L;
      }
      finally {
      return 3L;
      }
      }
      }
      -----------------------------------------

      jdk1.2S/solaris/bin/javac compiler outputs:

      ERROR: sun.tools.java.CompilerError: stack depth error 1/0: $7:
      -- listing --
      $2:
      3: try -872455688
      4: lconst_1 1
      4: pop
      4: goto $7:
      $4:
      $5:
      3: pop
      $7:
      7: ldc2_w 3
      7: lreturn
      sun.tools.java.CompilerError: stack depth error 1/0: $7:
      at sun.tools.asm.Assembler.balance(Assembler.java:256)
      at sun.tools.asm.Assembler.balance(Assembler.java:286)
      at sun.tools.asm.Assembler.write(Assembler.java:378)
      at sun.tools.javac.SourceClass.compileClass(SourceClass.java:1696)
      at sun.tools.javac.SourceClass.compile(SourceClass.java:1417)
      at sun.tools.javac.Main.compile(Main.java:388)
      at sun.tools.javac.Main.main(Main.java:543)
      error: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
      1 error
      -----------------------------------------

      ======================================================================

            dstoutamsunw David Stoutamire (Inactive)
            dkhukhrosunw Dmitry Khukhro (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: