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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.2.2_13, 1.3.1, 1.4.0
    • Fix Version/s: 1.4.0
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      generic, sparc
    • OS:
      generic, solaris_7, solaris_8
    • Verification:
      Verified

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gafter Neal Gafter
                Reporter:
                gafter Neal Gafter
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: