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

VerifyError when inner class is accessed in prologue

XMLWordPrintable

    • b28

        static class Test {
            class InnerClass { int a; }

            Test(int a) {
                this.new InnerClass().a = 1;
                super();
            }
        }

        public static void main(String argv[]) {
            new Test(1);
        }

        Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
        Exception Details:
          Location:
            Test.<init>(I)V @5: invokespecial
          Reason:
            Type uninitializedThis (current frame, stack[2]) is not assignable to 'Test'
          Current Frame:
            bci: @5
            flags: { flagThisUninit }
            locals: { uninitializedThis, integer }
            stack: { uninitialized 0, uninitialized 0, uninitializedThis }
          Bytecode:
            0000000: bb00 0159 2ab7 0003 04b5 0007 04b3 000b
            0000010: 1b3d 2ab7 0011 b1
         
                        at Main.run(Main.java:31)
                        at Main.main(Main.java:27)

        java --version
        openjdk 23-ea 2024-09-17
        OpenJDK Runtime Environment (build 23-ea+25-2094)
        OpenJDK 64-Bit Server VM (build 23-ea+25-2094, mixed mode, sharing)

              acobbs Archie Cobbs
              eananeva Ella Ananeva
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: