diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-07-07 10:15:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-07 10:48:25 +0100 |
commit | 0d78ad871e85a74a2a7eac2f2a2ff94776f35e77 (patch) | |
tree | a29ea7098cc49b1116db16f219bdc662e04ac874 /sot | |
parent | clang scan-build: Dereference of null pointer (diff) | |
download | core-0d78ad871e85a74a2a7eac2f2a2ff94776f35e77.tar.gz core-0d78ad871e85a74a2a7eac2f2a2ff94776f35e77.zip |
DBG_ASSERT->assert when followed by dereference
Change-Id: Ic1c999ffdc391ea01be5711721e7c9e63179473e
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stgavl.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sot/source/sdstor/stgavl.cxx b/sot/source/sdstor/stgavl.cxx index 3cb48c2a1da9..93869ac9b042 100644 --- a/sot/source/sdstor/stgavl.cxx +++ b/sot/source/sdstor/stgavl.cxx @@ -131,7 +131,7 @@ short StgAvlNode::Adjust( StgAvlNode** pHeavy, StgAvlNode* pNew ) StgAvlNode* StgAvlNode::RotLL() { - OSL_ENSURE( pLeft, "The pointer is not allowed to be NULL!" ); + assert(pLeft && "The pointer is not allowed to be NULL!"); StgAvlNode *pHeavy = pLeft; pLeft = pHeavy->pRight; pHeavy->pRight = this; @@ -172,10 +172,9 @@ StgAvlNode* StgAvlNode::RotLR() } // perform RR rotation and return new root - StgAvlNode* StgAvlNode::RotRR() { - OSL_ENSURE( pRight, "The pointer is not allowed to be NULL!" ); + assert(pRight && "The pointer is not allowed to be NULL!" ); StgAvlNode* pHeavy = pRight; pRight = pHeavy->pLeft; pHeavy->pLeft = this; @@ -184,10 +183,9 @@ StgAvlNode* StgAvlNode::RotRR() } // perform the RL rotation and return the new root - StgAvlNode* StgAvlNode::RotRL() { - OSL_ENSURE( pRight && pRight->pLeft, "The pointer is not allowed to be NULL!" ); + assert(pRight && pRight->pLeft && "The pointer is not allowed to be NULL!"); StgAvlNode* pHeavy = pRight; StgAvlNode* pNewRoot = pHeavy->pLeft; pHeavy->pLeft = pNewRoot->pRight; @@ -297,7 +295,8 @@ bool StgAvlNode::Insert( StgAvlNode** pRoot, StgAvlNode* pIns ) short nRes = (*pRoot)->Locate( pIns, &pPivot, &pParent, &pPrev ); if( !nRes ) return false; - OSL_ENSURE( pPivot && pPrev, "The pointers may not be NULL!" ); + + assert(pPivot && pPrev && "The pointers may not be NULL!"); // add new node if( nRes < 0 ) |