Skip to content

Commit c36c320

Browse files
authored
Merge pull request #35568 from apple/SIL-Gate-checkForLeaksAfterDestruction-to-asserts-builds
SIL: Gate checkForLeaksAfterDestruction to asserts builds
2 parents 6e61279 + 9760533 commit c36c320

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/SIL/IR/SILModule.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,17 @@ void SILModule::checkForLeaks() const {
167167
}
168168

169169
void SILModule::checkForLeaksAfterDestruction() {
170+
// Disabled in release (non-assert) builds because this check fails in rare
171+
// cases in lldb, causing crashes. rdar://70826934
172+
#ifndef NDEBUG
170173
int numAllocated = SILInstruction::getNumCreatedInstructions() -
171174
SILInstruction::getNumDeletedInstructions();
172175

173176
if (numAllocated != 0) {
174177
llvm::errs() << "Leaking " << numAllocated << " instructions!\n";
175178
llvm_unreachable("leaking instructions");
176179
}
180+
#endif
177181
}
178182

179183
std::unique_ptr<SILModule> SILModule::createEmptyModule(

0 commit comments

Comments
 (0)