aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authordrh <>2023-04-29 17:13:39 +0000
committerdrh <>2023-04-29 17:13:39 +0000
commitf8ae2d2a2a23e4ad3f937712d30e2daf8d3b0c79 (patch)
tree5b44ffa19f048f8081ee4caeba0d9eaf1046d55a /src/json.c
parent399875f6c568bf7e674948c09686c0c7cabb21d9 (diff)
downloadsqlite-f8ae2d2a2a23e4ad3f937712d30e2daf8d3b0c79.tar.gz
sqlite-f8ae2d2a2a23e4ad3f937712d30e2daf8d3b0c79.zip
Add ALWAYS macros on unreachable branches in the new JSON5 logic.
FossilOrigin-Name: 91e15ed9d93e51b750172a074dbbcf206128e9476571ce6189b8ea0ba5ab4135
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/json.c b/src/json.c
index 17908fd97..7876bdcbc 100644
--- a/src/json.c
+++ b/src/json.c
@@ -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);