Use extra assert() statement to silence harmless static analyzer warnings.

FossilOrigin-Name: 174c2b2eef5fecd96a5fc89b81032fe81f7801f12097cea10e7e7f0a02114813
This commit is contained in:
drh 2023-12-05 19:24:07 +00:00
parent a0de45459e
commit 5afd67b3c3
3 changed files with 11 additions and 8 deletions

View File

@ -1,5 +1,5 @@
C Miscellaneous\scomment\scleanup\sand\stypo\sfixes.
D 2023-12-05T18:28:15.619
C Use\sextra\sassert()\sstatement\sto\ssilence\sharmless\sstatic\sanalyzer\swarnings.
D 2023-12-05T19:24:07.192
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
@ -688,7 +688,7 @@ F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51
F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
F src/insert.c 3f0a94082d978bbdd33c38fefea15346c6c6bffb70bc645a71dc0f1f87dd3276
F src/json.c 00480474f134f18d77275de3fe1220b198059af39d41b8549f14af991ee50c64
F src/json.c 0a6095d10a8c8251e1838a1f12abc89125b0b05f82497ad12896a7f714e397ce
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36
F src/main.c 1b89f3de98d1b59fec5bac1d66d6ece21f703821b8eaa0d53d9604c35309f6f9
@ -2145,8 +2145,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 843197df08352bdff4b87be91d160e574572aded0d0c66142fd960000c0b4701
R 51649fd2031c328be393a9b165de9b28
P 59446dc0bd0091572122a3c8b4653d7a2dc867d16c4a5919f79b81bc3a673ce3
R 901a6c57f6544c02dc1f928ffbc0f678
U drh
Z 92ba2a23f6f1deba28c66b8e97e6bff1
Z d3a76b74f5e90cbdae4d0a0216cf9ffb
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
59446dc0bd0091572122a3c8b4653d7a2dc867d16c4a5919f79b81bc3a673ce3
174c2b2eef5fecd96a5fc89b81032fe81f7801f12097cea10e7e7f0a02114813

View File

@ -1119,6 +1119,7 @@ static void jsonBlobAppendNode(
jsonBlobExpandAndAppendNode(pParse,eType,szPayload,aPayload);
return;
}
assert( pParse->aBlob!=0 );
a = &pParse->aBlob[pParse->nBlob];
if( szPayload<=11 ){
a[0] = eType | (szPayload<<4);
@ -2288,6 +2289,8 @@ static u32 jsonLookupStep(
nIns = ix.nBlob + nKey + v.nBlob;
jsonBlobEdit(pParse, j, 0, 0, nIns);
if( !pParse->oom ){
assert( pParse->aBlob!=0 ); /* Because pParse->oom!=0 */
assert( ix.aBlob!=0 ); /* Because pPasre->oom!=0 */
memcpy(&pParse->aBlob[j], ix.aBlob, ix.nBlob);
k = j + ix.nBlob;
memcpy(&pParse->aBlob[k], zKey, nKey);
@ -4406,7 +4409,7 @@ static int jsonEachColumn(
}
case JEACH_TYPE: {
u32 i = jsonSkipLabel(p);
u8 eType = eType = p->sParse.aBlob[i] & 0x0f;
u8 eType = p->sParse.aBlob[i] & 0x0f;
sqlite3_result_text(ctx, jsonbType[eType], -1, SQLITE_STATIC);
break;
}