From f8ae2d2a2a23e4ad3f937712d30e2daf8d3b0c79 Mon Sep 17 00:00:00 2001 From: drh <> Date: Sat, 29 Apr 2023 17:13:39 +0000 Subject: Add ALWAYS macros on unreachable branches in the new JSON5 logic. FossilOrigin-Name: 91e15ed9d93e51b750172a074dbbcf206128e9476571ce6189b8ea0ba5ab4135 --- src/json.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/json.c') 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; iiErr && z[i]; i++){ + for(i=0; iiErr && ALWAYS(z[i]); i++){ if( (z[i]&0xc0)!=0x80 ) n++; } sqlite3_result_int(ctx, n); -- cgit v1.2.3