C: fix bug in virtual table builder

This commit is contained in:
Alexey Andreev 2019-05-27 11:57:57 +03:00
parent 336590314c
commit d818b62686

View File

@ -126,13 +126,12 @@ public class VirtualTableBuilder {
List<MethodDescriptor> methodsAtCallSites = methodsUsedAtCallSites.get(className);
if (methodsAtCallSites != null) {
for (MethodDescriptor methodDesc : methodsAtCallSites) {
MethodReader method = cls.getMethod(methodDesc);
if (method != null) {
if (method.hasModifier(ElementModifier.FINAL)
|| method.getLevel() == AccessLevel.PRIVATE
|| cls.hasModifier(ElementModifier.FINAL)) {
if (cls.hasModifier(ElementModifier.FINAL) && !table.entries.containsKey(methodDesc)) {
continue;
}
MethodReader method = cls.getMethod(methodDesc);
if (method != null && method.getLevel() == AccessLevel.PRIVATE) {
continue;
}
table.entries.computeIfAbsent(methodDesc, k -> new EntryBuilder());
}
@ -148,9 +147,7 @@ public class VirtualTableBuilder {
EntryBuilder entry = table.entries.get(method.getDescriptor());
if (entry == null) {
if (method.hasModifier(ElementModifier.FINAL)
|| method.getLevel() == AccessLevel.PRIVATE
|| cls.hasModifier(ElementModifier.FINAL)) {
if (cls.hasModifier(ElementModifier.FINAL)) {
continue;
}
entry = new EntryBuilder();