< prev index next >

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

Print this page

        

@@ -1197,11 +1197,18 @@
                     for (int j = readUnsignedShort(u + 8), v = u; j > 0; --j) {
                         int label = readUnsignedShort(v + 10);
                         if (labels[label] == null) {
                             readLabel(label, labels).status |= Label.DEBUG;
                         }
-                        labels[label].line = readUnsignedShort(v + 12);
+                        Label l = labels[label];
+                        while (l.line > 0) {
+                            if (l.next == null) {
+                                l.next = new Label();
+                            }
+                            l = l.next;
+                        }
+                        l.line = readUnsignedShort(v + 12);
                         v += 4;
                     }
                 }
             } else if (ANNOTATIONS
                     && "RuntimeVisibleTypeAnnotations".equals(attrName)) {

@@ -1312,15 +1319,21 @@
             int offset = u - codeStart;
 
             // visits the label and line number for this offset, if any
             Label l = labels[offset];
             if (l != null) {
+                Label next = l.next;
+                l.next = null;
                 mv.visitLabel(l);
                 if ((context.flags & SKIP_DEBUG) == 0 && l.line > 0) {
                     mv.visitLineNumber(l.line, l);
+                    while (next != null) {
+                        mv.visitLineNumber(next.line, l);
+                        next = next.next;
                 }
             }
+            }
 
             // visits the frame for this offset, if any
             while (FRAMES && frame != null
                     && (frame.offset == offset || frame.offset == -1)) {
                 // if there is a frame for this offset, makes the visitor visit

@@ -1855,28 +1868,25 @@
         case 'D': // pointer to CONSTANT_Double
             av.visit(name, readConst(readUnsignedShort(v), buf));
             v += 2;
             break;
         case 'B': // pointer to CONSTANT_Byte
-            av.visit(name,
-                    (byte) readInt(items[readUnsignedShort(v)]));
+            av.visit(name, (byte) readInt(items[readUnsignedShort(v)]));
             v += 2;
             break;
         case 'Z': // pointer to CONSTANT_Boolean
             av.visit(name,
                     readInt(items[readUnsignedShort(v)]) == 0 ? Boolean.FALSE
                             : Boolean.TRUE);
             v += 2;
             break;
         case 'S': // pointer to CONSTANT_Short
-            av.visit(name,
-                    (short) readInt(items[readUnsignedShort(v)]));
+            av.visit(name, (short) readInt(items[readUnsignedShort(v)]));
             v += 2;
             break;
         case 'C': // pointer to CONSTANT_Char
-            av.visit(name,
-                    (char) readInt(items[readUnsignedShort(v)]));
+            av.visit(name, (char) readInt(items[readUnsignedShort(v)]));
             v += 2;
             break;
         case 's': // pointer to CONSTANT_Utf8
             av.visit(name, readUTF8(v, buf));
             v += 2;

@@ -2513,13 +2523,14 @@
             return Type.getMethodType(readUTF8(index, buf));
         default: // case ClassWriter.HANDLE_BASE + [1..9]:
             int tag = readByte(index);
             int[] items = this.items;
             int cpIndex = items[readUnsignedShort(index + 1)];
+            boolean itf = b[cpIndex - 1] == ClassWriter.IMETH;
             String owner = readClass(cpIndex, buf);
             cpIndex = items[readUnsignedShort(cpIndex + 2)];
             String name = readUTF8(cpIndex, buf);
             String desc = readUTF8(cpIndex + 2, buf);
-            return new Handle(tag, owner, name, desc);
+            return new Handle(tag, owner, name, desc, itf);
         }
     }
 }
< prev index next >