1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-23 21:49:02 +03:00

Avoid zero-length memmove() calls when appending B-tree cells.

FossilOrigin-Name: d75a9fd3cf5d805e57173356bf60c100e2c089a0fc94d7fccdc777fe6cc27da7
This commit is contained in:
jeffchen
2026-10-16 08:43:47 +00:00
parent 848cad0ec0
commit 739ac505c3
4 changed files with 15 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
C Deal\swith\sharmless\s32-bit\sinteger\soverflow\son\sparameters\sto\ssome\sextension\nSQL\sfunctions.\n[bugs:/info/2026-10-15T04:34:08Z|Bug\s2026-10-15T04:34:08Z]
D 2026-10-15T21:46:13.627
C Avoid\szero-length\smemmove()\scalls\swhen\sappending\sB-tree\scells.
D 2026-10-16T08:43:47.294
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -744,7 +744,7 @@ F src/auth.c b5ece4e1edccad082c0332fa0087df225473bae0feea9269f824312201377185
F src/backup.c f6a1490f4ef86cca51f0f93158bbc140b5822406e0c50ec61731e3fcdc1242a2
F src/bitvec.c e242d4496774dfc88fa278177dd23b607dce369ccafb3f61b41638eea2c9b399
F src/btmutex.c 30dada73a819a1ef5b7583786370dce1842e12e1ad941e4d05ac29695528daea
F src/btree.c 3c6396c468bd34a847e6621ce14709da0f448dee92840d4e222a3c3142d95bbf
F src/btree.c 8e446c258caa2af557f80170c725bc3b4aae1e1292f8c11d2c577dc3065841dd
F src/btree.h 2ee0ddfdf4f8530ad1d46afffd7da21a0e243bfab10973011ac6f6b7fb4109a1
F src/btreeInt.h df956bca48cd49d2a38886bc3b02045c039e8a16353f86fccd116c6487f79d82
F src/build.c 1406d252bc5b2c3f2150edd4426e5981eabf1000944be8db8d470b96eb64ee07
@@ -2291,8 +2291,11 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
P 90cab4aceaee8955e57694231f025a22ad86924e036f3ce271cbb332cbd1bb4b
R 00aa0d7b8566f18aaeef1bdc48f5e899
U drh
Z 5dff44861822421062eedc6dbc38e13f
P ca52702835d16afd04e936bc4d57f78f0c4d37f83b19b632122f6a699009ca3c
R cc82fe3cfeef8deddd47cf05f9c9d6d4
T *branch * opt-btree-insertcell-skip-empty-memmove
T *sym-opt-btree-insertcell-skip-empty-memmove *
T -sym-trunk *
U jeffchen
Z c050cfd9c990eab534ff897622144891
# Remove this line to create a well-formed Fossil manifest.

View File

@@ -1,2 +1,2 @@
branch trunk
tag trunk
branch opt-btree-insertcell-skip-empty-memmove
tag opt-btree-insertcell-skip-empty-memmove

View File

@@ -1 +1 @@
ca52702835d16afd04e936bc4d57f78f0c4d37f83b19b632122f6a699009ca3c
d75a9fd3cf5d805e57173356bf60c100e2c089a0fc94d7fccdc777fe6cc27da7

View File

@@ -7427,7 +7427,7 @@ static int insertCell(
memcpy(&data[idx+4], pCell+4, sz-4);
put4byte(&data[idx], iChild);
pIns = pPage->aCellIdx + i*2;
memmove(pIns+2, pIns, 2*(pPage->nCell - i));
if( i<pPage->nCell ) memmove(pIns+2, pIns, 2*(pPage->nCell - i));
put2byte(pIns, idx);
pPage->nCell++;
/* increment the cell count */
@@ -7511,7 +7511,7 @@ static int insertCellFast(
pPage->nFree -= (u16)(2 + sz);
memcpy(&data[idx], pCell, sz);
pIns = pPage->aCellIdx + i*2;
memmove(pIns+2, pIns, 2*(pPage->nCell - i));
if( i<pPage->nCell ) memmove(pIns+2, pIns, 2*(pPage->nCell - i));
put2byte(pIns, idx);
pPage->nCell++;
/* increment the cell count */