We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dccb5ac commit dfbb2bdCopy full SHA for dfbb2bd
lib/SIL/Verifier/SILVerifier.cpp
@@ -4880,6 +4880,17 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
4880
}
4881
4882
void checkBranchInst(BranchInst *BI) {
4883
+ for (auto arg : BI->getArgs()) {
4884
+ auto *borrow = dyn_cast<BeginBorrowInst>(arg);
4885
+ if (!borrow) {
4886
+ continue;
4887
+ }
4888
+ auto op = borrow->getOperand();
4889
+ if (op->getOwnershipKind() != OwnershipKind::Guaranteed) {
4890
4891
4892
+ assert(!isGuaranteedForwarding(op));
4893
4894
require(BI->getArgs().size() == BI->getDestBB()->args_size(),
4895
"branch has wrong number of arguments for dest bb");
4896
require(std::equal(BI->getArgs().begin(), BI->getArgs().end(),
0 commit comments