Skip to content

Commit 41e14ed

Browse files
committed
We can't pass Objective-C methods as branch arguments
1 parent fa82965 commit 41e14ed

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/SIL/SILVerifier.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4004,6 +4004,13 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
40044004
require(!(isa<MethodInst>(branchArg) &&
40054005
cast<MethodInst>(branchArg)->getMember().isForeign),
40064006
"branch argument cannot be a witness_method or an objc method_inst");
4007+
require(!(branchArg->getType().is<SILFunctionType>() &&
4008+
branchArg->getType()
4009+
.castTo<SILFunctionType>()
4010+
->getExtInfo()
4011+
.getRepresentation() ==
4012+
SILFunctionTypeRepresentation::ObjCMethod),
4013+
"branch argument cannot be a objective-c method");
40074014
return branchArg->getType() == bbArg->getType();
40084015
}
40094016

0 commit comments

Comments
 (0)