< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java

Print this page
*** 1829,10 ***
--- 1829,12 ---
                  case Constants.LDC2_W:
                  case Opcodes.GETSTATIC:
                  case Opcodes.PUTSTATIC:
                  case Opcodes.GETFIELD:
                  case Opcodes.PUTFIELD:
+                 case Opcodes.DEFAULT:
+                 case Opcodes.WITHFIELD:
                  case Opcodes.INVOKEVIRTUAL:
                  case Opcodes.INVOKESPECIAL:
                  case Opcodes.INVOKESTATIC:
                  case Opcodes.NEW:
                  case Opcodes.ANEWARRAY:

*** 2441,22 ***
                  case Opcodes.PUTFIELD:
                  case Opcodes.INVOKEVIRTUAL:
                  case Opcodes.INVOKESPECIAL:
                  case Opcodes.INVOKESTATIC:
                  case Opcodes.INVOKEINTERFACE:
                      {
                          int cpInfoOffset = cpInfoOffsets[readUnsignedShort(currentOffset + 1)];
                          int nameAndTypeCpInfoOffset = cpInfoOffsets[readUnsignedShort(cpInfoOffset + 2)];
                          String owner = readClass(cpInfoOffset, charBuffer);
                          String name = readUTF8(nameAndTypeCpInfoOffset, charBuffer);
                          String descriptor = readUTF8(nameAndTypeCpInfoOffset + 2, charBuffer);
!                         if (opcode < Opcodes.INVOKEVIRTUAL) {
-                             methodVisitor.visitFieldInsn(opcode, owner, name, descriptor);
-                         } else {
                              boolean isInterface =
                                      classBuffer[cpInfoOffset - 1] == Symbol.CONSTANT_INTERFACE_METHODREF_TAG;
                              methodVisitor.visitMethodInsn(opcode, owner, name, descriptor, isInterface);
                          }
                          if (opcode == Opcodes.INVOKEINTERFACE) {
                              currentOffset += 5;
                          } else {
                              currentOffset += 3;
--- 2443,23 ---
                  case Opcodes.PUTFIELD:
                  case Opcodes.INVOKEVIRTUAL:
                  case Opcodes.INVOKESPECIAL:
                  case Opcodes.INVOKESTATIC:
                  case Opcodes.INVOKEINTERFACE:
+                 case Opcodes.WITHFIELD:
                      {
                          int cpInfoOffset = cpInfoOffsets[readUnsignedShort(currentOffset + 1)];
                          int nameAndTypeCpInfoOffset = cpInfoOffsets[readUnsignedShort(cpInfoOffset + 2)];
                          String owner = readClass(cpInfoOffset, charBuffer);
                          String name = readUTF8(nameAndTypeCpInfoOffset, charBuffer);
                          String descriptor = readUTF8(nameAndTypeCpInfoOffset + 2, charBuffer);
!                         if (opcode >= Opcodes.INVOKEVIRTUAL && opcode <= Opcodes.INVOKEINTERFACE) {
                              boolean isInterface =
                                      classBuffer[cpInfoOffset - 1] == Symbol.CONSTANT_INTERFACE_METHODREF_TAG;
                              methodVisitor.visitMethodInsn(opcode, owner, name, descriptor, isInterface);
+                         } else {
+                             methodVisitor.visitFieldInsn(opcode, owner, name, descriptor);
                          }
                          if (opcode == Opcodes.INVOKEINTERFACE) {
                              currentOffset += 5;
                          } else {
                              currentOffset += 3;

*** 2487,10 ***
--- 2490,11 ---
                      }
                  case Opcodes.NEW:
                  case Opcodes.ANEWARRAY:
                  case Opcodes.CHECKCAST:
                  case Opcodes.INSTANCEOF:
+                 case Opcodes.DEFAULT:
                      methodVisitor.visitTypeInsn(opcode, readClass(currentOffset + 1, charBuffer));
                      currentOffset += 3;
                      break;
                  case Opcodes.IINC:
                      methodVisitor.visitIincInsn(

*** 3238,11 ***
                      break;
                  case '[':
                      while (methodDescriptor.charAt(currentMethodDescritorOffset) == '[') {
                          ++currentMethodDescritorOffset;
                      }
!                     if (methodDescriptor.charAt(currentMethodDescritorOffset) == 'L') {
                          ++currentMethodDescritorOffset;
                          while (methodDescriptor.charAt(currentMethodDescritorOffset) != ';') {
                              ++currentMethodDescritorOffset;
                          }
                      }
--- 3242,12 ---
                      break;
                  case '[':
                      while (methodDescriptor.charAt(currentMethodDescritorOffset) == '[') {
                          ++currentMethodDescritorOffset;
                      }
!                     char descType = methodDescriptor.charAt(currentMethodDescritorOffset);
+                     if (descType == 'L' || descType == 'Q') {
                          ++currentMethodDescritorOffset;
                          while (methodDescriptor.charAt(currentMethodDescritorOffset) != ';') {
                              ++currentMethodDescritorOffset;
                          }
                      }
< prev index next >