C: fix virtual tables

This commit is contained in:
Alexey Andreev 2019-05-16 18:58:36 +03:00
parent f5c2cf0fa3
commit 816434500c

View File

@ -107,9 +107,12 @@ public class VirtualTableProvider {
private void copyEntriesFromSupertype(VirtualTable table, VirtualTable supertypeTable) { private void copyEntriesFromSupertype(VirtualTable table, VirtualTable supertypeTable) {
for (VirtualTableEntry parentEntry : supertypeTable.entries.values()) { for (VirtualTableEntry parentEntry : supertypeTable.entries.values()) {
VirtualTableEntry entry = new VirtualTableEntry(table, parentEntry.getMethod(), VirtualTableEntry existingEntry = table.entries.get(parentEntry.getMethod());
parentEntry.getImplementor(), parentEntry.getIndex()); if (existingEntry == null || existingEntry.getImplementor() == null) {
table.entries.put(entry.getMethod(), entry); VirtualTableEntry entry = new VirtualTableEntry(table, parentEntry.getMethod(),
parentEntry.getImplementor(), parentEntry.getIndex());
table.entries.put(entry.getMethod(), entry);
}
} }
} }