1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Work around an apparent GCC UBSAN bug. See

[forum:/forumpost/1d7c25d4a2d6f5e2|forum thread 1d7c25d4a2d] for details.

FossilOrigin-Name: 23056532e51abcff486e38a3319545e6663b4a855abe1bc443e2cd7e0473748c
This commit is contained in:
drh
2025-06-26 18:57:20 +00:00
parent 981022b7ff
commit e77e589a35
3 changed files with 14 additions and 9 deletions

View File

@@ -8696,7 +8696,12 @@ static int balance_nonroot(
** of the right-most new sibling page is set to the value that was
** originally in the same field of the right-most old sibling page. */
if( (pageFlags & PTF_LEAF)==0 && nOld!=nNew ){
MemPage *pOld = (nNew>nOld ? apNew : apOld)[nOld-1];
MemPage *pOld;
if( nNew>nOld ){
pOld = apNew[nOld-1];
}else{
pOld = apOld[nOld-1];
}
memcpy(&apNew[nNew-1]->aData[8], &pOld->aData[8], 4);
}