Skip to content

Commit baf88b8

Browse files
committed
Add constant pool tag type 17 (#527)
1 parent c5bc253 commit baf88b8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/io/github/classgraph/Classfile.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ private Object getFieldConstantPoolValue(final int tag, final char fieldTypeDesc
928928
default:
929929
// ClassGraph doesn't expect other types
930930
// (N.B. in particular, enum values are not stored in the constant pool, so don't need to be handled)
931-
throw new ClassfileFormatException("Unknown constant pool tag " + tag + ", "
931+
throw new ClassfileFormatException("Unknown field constant pool tag " + tag + ", "
932932
+ "cannot continue reading class. Please report this at "
933933
+ "https://github.com/classgraph/classgraph/issues");
934934
}
@@ -1097,13 +1097,14 @@ private void readConstantPoolEntries() throws IOException {
10971097
entryOffset[i] = reader.currPos();
10981098
switch (entryTag[i]) {
10991099
case 0: // Impossible, probably buffer underflow
1100-
throw new ClassfileFormatException("Unknown constant pool tag 0 in classfile " + relativePath
1100+
throw new ClassfileFormatException("Invalid constant pool tag 0 in classfile " + relativePath
11011101
+ " (possible buffer underflow issue). Please report this at "
11021102
+ "https://github.com/classgraph/classgraph/issues");
11031103
case 1: // Modified UTF8
11041104
final int strLen = reader.readUnsignedShort();
11051105
reader.skip(strLen);
11061106
break;
1107+
// There is no constant pool tag type 2
11071108
case 3: // int, short, char, byte, boolean are all represented by Constant_INTEGER
11081109
case 4: // float
11091110
reader.skip(4);
@@ -1145,12 +1146,16 @@ private void readConstantPoolEntries() throws IOException {
11451146
}
11461147
indirectStringRefs[i] = (nameRef << 16) | typeRef;
11471148
break;
1149+
// There is no constant pool tag type 13 or 14
11481150
case 15: // method handle
11491151
reader.skip(3);
11501152
break;
11511153
case 16: // method type
11521154
reader.skip(2);
11531155
break;
1156+
case 17: // dynamic
1157+
reader.skip(4);
1158+
break;
11541159
case 18: // invoke dynamic
11551160
reader.skip(4);
11561161
break;

0 commit comments

Comments
 (0)