Skip to content

Commit f179e5d

Browse files
committed
Verify load_borrow's unchecked bit is off in canonical SIL
1 parent a150c67 commit f179e5d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2728,6 +2728,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
27282728
requireSameType(LBI->getOperand()->getType().getObjectType(),
27292729
LBI->getType(),
27302730
"Load operand type and result type mismatch");
2731+
require(F.getModule().getStage() == SILStage::Raw || !LBI->isUnchecked(),
2732+
"load_borrow's unchecked bit is on");
27312733
}
27322734

27332735
void checkBeginBorrowInst(BeginBorrowInst *bbi) {

0 commit comments

Comments
 (0)