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

Compiler gen's (dead) valueless return in a value-returning function

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.2.2_13, 1.3.1, 1.4.0
    • tools
    • None
    • beta
    • generic, sparc
    • generic, solaris_7, solaris_8
    • Verified

      See 4357968. The compiler emits an unreachable return instruction in a
      value-returning function. This confuses some VMs including the KVM and
      the 1.2.2 JIT. While it may be arguably legal, it would be better to either
      emit the correct return instruction or anything else - like a small
      infinite loop - that won't confuse these VMs.

      Perhaps it would be better to use a more clever code generation
      strategy that is able to avoid generating any dead code at all. Be
      that as it may, better to generate valid dead code than invalid dead code.

      Object myMethod() {
         Object retVal=null;

         try {
          ...
         } except() {
          ...
         } finally {
          return retVal;
         }
      }

      neal.gafter@Eng 2001-02-15

            gafter Neal Gafter (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: