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

Add NEVER() to two error-detection tests that were made unreachable by

the previous check-in.

FossilOrigin-Name: 5166acf3f00404597e77910aee88920ab833af8447766f50bf4f70525606cf95
This commit is contained in:
drh
2022-09-30 20:48:22 +00:00
parent ad658b2d82
commit 0a803bd984
3 changed files with 10 additions and 17 deletions

View File

@@ -4954,7 +4954,7 @@ static int accessPayload(
assert( pPage );
assert( eOp==0 || eOp==1 );
assert( pCur->eState==CURSOR_VALID );
if( pCur->ix>=pPage->nCell ){
if( NEVER(pCur->ix>=pPage->nCell) ){
return SQLITE_CORRUPT_PAGE(pPage);
}
assert( cursorHoldsMutex(pCur) );
@@ -6077,14 +6077,7 @@ static SQLITE_NOINLINE int btreeNext(BtCursor *pCur){
pPage = pCur->pPage;
idx = ++pCur->ix;
if( !pPage->isInit || sqlite3FaultSim(412) ){
/* The only known way for this to happen is for there to be a
** recursive SQL function that does a DELETE operation as part of a
** SELECT which deletes content out from under an active cursor
** in a corrupt database file where the table being DELETE-ed from
** has pages in common with the table being queried. See TH3
** module cov1/btree78.test testcase 220 (2018-06-08) for an
** example. */
if( NEVER(!pPage->isInit) || sqlite3FaultSim(412) ){
return SQLITE_CORRUPT_BKPT;
}