From 9fe1b7c53df5cb3a612ab30866437ced0a406fd0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 30 Apr 2024 09:45:30 +0100 Subject: WaE: C6011 Dereferencing NULL pointer warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit upgrade to asserts Change-Id: Iaf4ad07b87496e2e2039e01a4e5ceb6128cdd012 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166919 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- store/source/lockbyte.cxx | 4 ++-- store/source/storbase.hxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'store') diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx index 87aefdbe4185..c89a3e2ff741 100644 --- a/store/source/lockbyte.cxx +++ b/store/source/lockbyte.cxx @@ -372,7 +372,7 @@ storeError FileLockBytes::readPageAt_Impl (std::shared_ptr & rPage, sa storeError FileLockBytes::writePageAt_Impl (std::shared_ptr const & rPage, sal_uInt32 nOffset) { PageData const * pagedata = rPage.get(); - OSL_PRECOND(pagedata != nullptr, "contract violation"); + assert(pagedata != nullptr && "contract violation"); return writeAt_Impl (nOffset, pagedata, pagedata->size()); } @@ -716,7 +716,7 @@ storeError MemoryLockBytes::readPageAt_Impl (std::shared_ptr & rPage, storeError MemoryLockBytes::writePageAt_Impl (std::shared_ptr const & rPage, sal_uInt32 nOffset) { PageData const * pagedata = rPage.get(); - OSL_PRECOND(!(pagedata == nullptr), "contract violation"); + assert(pagedata != nullptr && "contract violation"); return writeAt_Impl (nOffset, pagedata, pagedata->size()); } diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx index 207cbf40a8d3..6f9a4956ebd9 100644 --- a/store/source/storbase.hxx +++ b/store/source/storbase.hxx @@ -490,7 +490,7 @@ public: pHead->guard(nAddr); T * pImpl = dynamic_page_cast(pHead); - OSL_PRECOND(pImpl != nullptr, "store::PageHolder::guard(): Null pointer"); + assert(pImpl != nullptr && "store::PageHolder::guard(): Null pointer"); pImpl->guard(); return store_E_None; -- cgit