Skip to content

Commit

Permalink
Mimic HotSpot: only check that InnerClasses.inner_name_index is a val…
Browse files Browse the repository at this point in the history
…id UTF8 constant.
  • Loading branch information
mukel committed Apr 6, 2021
1 parent cbd1515 commit 6248f8b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,9 @@ private InnerClassesAttribute.Entry parseInnerClassEntry() {
pool.classAt(outerClassIndex).validate(pool);
}
if (innerNameIndex != 0) {
pool.utf8At(innerNameIndex).validateClassName();
// Gradle (the build tool) generates classes with innerNameIndex -> empty string.
// HotSpot does not validates the class name, only that it is a valid UTF-8 constant.
pool.utf8At(innerNameIndex).validate(pool); // .validateClassName();
}
return new InnerClassesAttribute.Entry(innerClassIndex, outerClassIndex, innerNameIndex, innerClassAccessFlags);
}
Expand Down

0 comments on commit 6248f8b

Please sign in to comment.