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

Verification error due to a bad stackmap frame generated by javac

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Withdrawn
    • Icon: P3 P3
    • 9
    • 7u45, 8, 9
    • tools
    • None
    • b24


        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();
                 }
        }

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

                Created:
                Updated:
                Resolved: