diff --git a/lib/SIL/Verifier/SILOwnershipVerifier.cpp b/lib/SIL/Verifier/SILOwnershipVerifier.cpp index d3f56b34f32c3..1bc54503a27ae 100644 --- a/lib/SIL/Verifier/SILOwnershipVerifier.cpp +++ b/lib/SIL/Verifier/SILOwnershipVerifier.cpp @@ -914,6 +914,8 @@ void SILModule::verifyOwnership() const { void SILFunction::verifyOwnership(DeadEndBlocks *deadEndBlocks) const { if (DisableOwnershipVerification) return; + if (!getModule().getOptions().VerifySILOwnership) + return; #ifdef NDEBUG // When compiling without asserts enabled, only verify ownership if