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

javac generates LVT entry with length 0 for local variable

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b46
    • Verification:
      Verified

      Backports

        Description

        When compiling this test case:

        class Test {
          int m(boolean flag) {
            int myInt;
            label:
            {
              if (flag) {
                myInt = 1;
              } else {
                break label;
              }

              return myInt;
            }
            return -1;
          }
        }

        javac generates this incorrect LVT table for method m:

        LocalVariableTable:
                Start Length Slot Name Signature
                    6 0 2 myInt I <-------------- length is set to 0
                    0 10 0 this LTest;
                    0 10 1 flag Z

        reported in compiler-dev: http://mail.openjdk.java.net/pipermail/compiler-dev/2014-November/009141.html

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                vromero Vicente Arturo Romero Zaldivar
                Reporter:
                vromero Vicente Arturo Romero Zaldivar
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: