mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL verifier: Check that a class_method's type matches its override abstraction level.
Factor the code to compute an override's vtable type out of SILGen's emitVTableMethod into a method on TypeLowering, and use it to verify the type of class_method instructions. This catches rdar://problem/20874966 at SILGen time instead of letting the devirtualizer barf on it. Swift SVN r29158
This commit is contained in:
@@ -745,6 +745,13 @@ public:
|
||||
ClassMethodInst(Loc, Operand, Member, MethodTy, Volatile));
|
||||
}
|
||||
|
||||
/// Emit a class_method reference to the least derived overridden decl for
|
||||
/// the given method, and upcast the "self" pointer to the matching superclass
|
||||
/// type.
|
||||
std::pair<ClassMethodInst *, SILValue>
|
||||
emitClassMethod(SILLocation Loc, SILValue Self, SILDeclRef Member,
|
||||
bool Volatile = false);
|
||||
|
||||
SuperMethodInst *createSuperMethod(SILLocation Loc, SILValue Operand,
|
||||
SILDeclRef Member, SILType MethodTy,
|
||||
bool Volatile = false) {
|
||||
|
||||
Reference in New Issue
Block a user