diff --git a/lib/SIL/IR/SILModule.cpp b/lib/SIL/IR/SILModule.cpp index 22bcbe9f1ac35..fbe26a3d4c7e5 100644 --- a/lib/SIL/IR/SILModule.cpp +++ b/lib/SIL/IR/SILModule.cpp @@ -167,6 +167,9 @@ void SILModule::checkForLeaks() const { } void SILModule::checkForLeaksAfterDestruction() { +// Disabled in release (non-assert) builds because this check fails in rare +// cases in lldb, causing crashes. rdar://70826934 +#ifndef NDEBUG int numAllocated = SILInstruction::getNumCreatedInstructions() - SILInstruction::getNumDeletedInstructions(); @@ -174,6 +177,7 @@ void SILModule::checkForLeaksAfterDestruction() { llvm::errs() << "Leaking " << numAllocated << " instructions!\n"; llvm_unreachable("leaking instructions"); } +#endif } std::unique_ptr SILModule::createEmptyModule(