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

Move two unreachable conditionals inside of NEVER() or assert().

FossilOrigin-Name: db4e9728fae5f7b0fad6aa0a5be317a7c9e7c417
This commit is contained in:
drh
2015-05-29 17:51:16 +00:00
parent 1f2d968622
commit e726622579
4 changed files with 15 additions and 10 deletions

View File

@@ -1335,7 +1335,11 @@ static int allocateSpace(MemPage *pPage, int nByte, int *pIdx){
** However, that integer is too large to be stored in a 2-byte unsigned
** integer, so a value of 0 is used in its place. */
top = get2byteNotZero(&data[hdr+5]);
if( gap>top || (u32)top>pPage->pBt->usableSize ) return SQLITE_CORRUPT_BKPT;
if( gap>top || NEVER((u32)top>pPage->pBt->usableSize) ){
/* The NEVER() is because a oversize "top" value will be blocked from
** reaching this point by btreeInitPage() or btreeGetUnusedPage() */
return SQLITE_CORRUPT_BKPT;
}
/* If there is enough space between gap and top for one more cell pointer
** array entry offset, and if the freelist is not empty, then search the