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

Verification error due to a bad stackmap frame generated by javac

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Withdrawn
    • Affects Version/s: 7u45, 8, 9
    • Fix Version/s: 9
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b24

      Backports

        Description


        The following test case causes verification errors. This is the simplest
        possible test case to recreate the issue.

        public class BugDemo {
            int jj_ntk;

                public static void main(String[] args) {
                BugDemo bd = new BugDemo();
                        bd.jj_ntk = args.length;
                        bd.foo();
                }

                final public void foo(){
                        while (true) {
                                int i =0;
                                switch (jj_ntk) {
                                        case 1:
                                                break;
                                        default: ;
                                }
                                break;
                        }

                        switch (jj_ntk) {
                                case 1:
                                        A j2 = (A)A.create(this);
                                        break;
                                default:
                                        swap();
                        }
          }

                public int jj_ntk() {
                        return jj_ntk;
                }
               
                public void swap() {
                     jj_ntk = (jj_ntk == 1)? 0:1;
                }
        }

        class A {
            public static A create(Object obj) {
                      return new A();
                 }
        }

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  vromero Vicente Arturo Romero Zaldivar
                  Reporter:
                  shadowbug Shadow Bug
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: