Skip to content

Commit b6c2e13

Browse files
authored
Merge pull request #15464 from shajrawi/mem2reg_resil
2 parents 8346603 + a232e1f commit b6c2e13

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ bool MemoryToRegisters::isWriteOnlyAllocation(AllocStackInst *ASI) {
277277
/// Promote a DebugValueAddr to a DebugValue of the given value.
278278
static void
279279
promoteDebugValueAddr(DebugValueAddrInst *DVAI, SILValue Value, SILBuilder &B) {
280+
assert(DVAI->getOperand()->getType().isLoadable(DVAI->getModule()) &&
281+
"Unexpected promotion of address-only type!");
280282
assert(Value && "Expected valid value");
281283
B.setInsertionPoint(DVAI);
282284
B.setCurrentDebugScope(DVAI->getDebugScope());

0 commit comments

Comments
 (0)