Skip to content

Commit

Permalink
Merge branch 'base'
Browse files Browse the repository at this point in the history
  • Loading branch information
sink772 committed Dec 6, 2023
2 parents 2e2a00e + d9a9983 commit a68a99d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions javaee/rt/src/java/foundation/icon/ee/score/Validator.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public static Method[] validate(byte[] codeBytes) throws ValidationException, Zi
throw fail(e, "malformed class file");
}
String cur = jar.mainClassName;
if (cur == null) {
throw fail("No main class name");
}
Map<Member, MemberDecl> mmap = new HashMap<>();
Set<String> visited = new HashSet<>();
while (cur != null) {
Expand All @@ -92,6 +95,9 @@ public static Method[] validate(byte[] codeBytes) throws ValidationException, Zi
mmap.putIfAbsent(m.getMember(), m);
}
visited.add(cur);
if (cv.getSuperName() == null) {
throw fail("No super class");
}
cur = Utilities.internalNameToFullyQualifiedName(cv.getSuperName());
if (visited.contains(cur)) {
fail("cyclic inheritance in main class " + jar.mainClassName);
Expand Down

0 comments on commit a68a99d

Please sign in to comment.