Skip to content

Commit 41eb451

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-rebranch
2 parents c501814 + 059b0c8 commit 41eb451

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/SIL/SILVerifier.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1630,8 +1630,16 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
16301630

16311631
void checkBuiltinInst(BuiltinInst *BI) {
16321632
// Check for special constraints on llvm intrinsics.
1633-
if (BI->getIntrinsicInfo().ID != llvm::Intrinsic::not_intrinsic)
1633+
if (BI->getIntrinsicInfo().ID != llvm::Intrinsic::not_intrinsic) {
16341634
verifyLLVMIntrinsic(BI, BI->getIntrinsicInfo().ID);
1635+
return;
1636+
}
1637+
1638+
// At this point, we know that we have a Builtin that is a Swift Builtin
1639+
// rather than an llvm intrinsic. Make sure our name corresponds to an
1640+
// actual ValueDecl. Otherwise, we have an invalid builtin.
1641+
require(getBuiltinValueDecl(BI->getModule().getASTContext(), BI->getName()),
1642+
"Invalid builtin name?!");
16351643
}
16361644

16371645
void checkFunctionRefBaseInst(FunctionRefBaseInst *FRI) {

0 commit comments

Comments
 (0)