mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[embedded] Serialize+deserialize vtables, fix using non-generic classes from other modules in embedded Swift
This commit is contained in:
@@ -518,6 +518,17 @@ SILVTable *SILModule::lookUpVTable(const ClassDecl *C,
|
||||
if (!Vtbl)
|
||||
return nullptr;
|
||||
|
||||
if (C->walkSuperclasses([&](ClassDecl *S) {
|
||||
SILVTable *Vtbl = getSILLoader()->lookupVTable(S);
|
||||
if (!Vtbl) {
|
||||
return TypeWalker::Action::Stop;
|
||||
}
|
||||
VTableMap[C] = Vtbl;
|
||||
return TypeWalker::Action::Continue;
|
||||
})) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// If we succeeded, map C -> VTbl in the table and return VTbl.
|
||||
VTableMap[C] = Vtbl;
|
||||
return Vtbl;
|
||||
|
||||
Reference in New Issue
Block a user