1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

New ALWAYS() and assert() to mark unreachable branches in rtree.c.

FossilOrigin-Name: f7ad73c49507c9436adc7fe1b865f801eefcc7ea6b3ba35e83e63029beb03016
This commit is contained in:
drh
2021-09-16 05:24:40 +00:00
parent 5f9c7ba9d8
commit c464ec6710
3 changed files with 11 additions and 10 deletions

View File

@ -2742,13 +2742,14 @@ static int removeNode(Rtree *pRtree, RtreeNode *pNode, int iHeight){
/* Remove the entry in the parent cell. */
rc = nodeParentIndex(pRtree, pNode, &iCell);
if( rc==SQLITE_OK ){
if( ALWAYS(rc==SQLITE_OK) ){
pParent = pNode->pParent;
pNode->pParent = 0;
rc = deleteCell(pRtree, pParent, iCell, iHeight+1);
assert( rc==SQLITE_OK );
}
rc2 = nodeRelease(pRtree, pParent);
if( rc==SQLITE_OK ){
if( ALWAYS(rc==SQLITE_OK) ){
rc = rc2;
}
if( rc!=SQLITE_OK ){
@ -2968,7 +2969,7 @@ static int rtreeInsertCell(
}
}else{
rc = AdjustTree(pRtree, pNode, pCell);
if( rc==SQLITE_OK ){
if( ALWAYS(rc==SQLITE_OK) ){
if( iHeight==0 ){
rc = rowidWrite(pRtree, pCell->iRowid, pNode->iNode);
}else{