1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Add new assert() statements to help out a static analyzer. Response to

[forum:/forumpost/17fe8ac32e0de4f5|forum post 17fe8ac32e0de4f5].

FossilOrigin-Name: 857f6d530949221d154b5120ecc2aa906418bec6f69d1c13197a432ba3cad8eb
This commit is contained in:
drh
2024-05-27 11:31:02 +00:00
parent 4ed784d1e8
commit ee8f926027
3 changed files with 10 additions and 7 deletions

View File

@@ -7568,6 +7568,7 @@ static int rebuildPage(
memcpy(&pTmp[j], &aData[j], usableSize - j);
for(k=0; ALWAYS(k<NB*2) && pCArray->ixNx[k]<=i; k++){}
assert( k<NB*2 );
pSrcEnd = pCArray->apEnd[k];
pData = pEnd;
@@ -7651,6 +7652,7 @@ static int pageInsertArray(
assert( CORRUPT_DB || pPg->hdrOffset==0 ); /* Never called on page 1 */
if( iEnd<=iFirst ) return 0;
for(k=0; ALWAYS(k<NB*2) && pCArray->ixNx[k]<=i ; k++){}
assert( k<NB*2 );
pEnd = pCArray->apEnd[k];
while( 1 /*Exit by break*/ ){
int sz, rc;
@@ -8762,6 +8764,7 @@ static int balance_nonroot(
assert( sz<=pBt->maxLocal+23 );
assert( iOvflSpace <= (int)pBt->pageSize );
for(k=0; ALWAYS(k<NB*2) && b.ixNx[k]<=j; k++){}
assert( k<NB*2 );
pSrcEnd = b.apEnd[k];
if( SQLITE_OVERFLOW(pSrcEnd, pCell, pCell+sz) ){
rc = SQLITE_CORRUPT_BKPT;