1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Add ALWAYS macros on unreachable branches in the new JSON5 logic.

FossilOrigin-Name: 91e15ed9d93e51b750172a074dbbcf206128e9476571ce6189b8ea0ba5ab4135
This commit is contained in:
drh
2023-04-29 17:13:39 +00:00
parent 399875f6c5
commit f8ae2d2a2a
3 changed files with 10 additions and 10 deletions

View File

@@ -1393,7 +1393,7 @@ json_parse_restart:
}
if( c=='e' || c=='E' ){
if( z[j-1]<'0' ){
if( z[j-1]=='.' && j-2>=i && sqlite3Isdigit(z[j-2]) ){
if( ALWAYS(z[j-1]=='.') && j-2>=i && sqlite3Isdigit(z[j-2]) ){
pParse->has5 = 1;
jnFlags |= JNODE_JSON5;
}else{
@@ -1421,7 +1421,7 @@ json_parse_restart:
break;
}
if( z[j-1]<'0' ){
if( z[j-1]=='.' && j-2>=i && sqlite3Isdigit(z[j-2]) ){
if( ALWAYS(z[j-1]=='.') && j-2>=i && sqlite3Isdigit(z[j-2]) ){
pParse->has5 = 1;
jnFlags |= JNODE_JSON5;
}else{
@@ -2626,7 +2626,7 @@ static void jsonErrorFunc(
int n = 1;
int i;
const char *z = p->zJson;
for(i=0; i<p->iErr && z[i]; i++){
for(i=0; i<p->iErr && ALWAYS(z[i]); i++){
if( (z[i]&0xc0)!=0x80 ) n++;
}
sqlite3_result_int(ctx, n);