Skip to content

Commit 5e1520e

Browse files
committed
SIL verification: non-address partial apply callee
1 parent 52c732f commit 5e1520e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,6 +1932,10 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
19321932
require(resultInfo->getExtInfo().hasContext(),
19331933
"result of closure cannot have a thin function type");
19341934

1935+
// We rely on all indirect captures to be in the argument list.
1936+
require(PAI->getCallee()->getType().isObject(),
1937+
"Closure callee must not be an address type.");
1938+
19351939
checkApplyTypeDependentArguments(PAI);
19361940

19371941
auto substTy = checkApplySubstitutions(PAI->getSubstitutionMap(),

0 commit comments

Comments
 (0)