diff options
author | drh <drh@noemail.net> | 2018-07-07 19:47:21 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-07-07 19:47:21 +0000 |
commit | fd4b72853ae8811741d060d413c6eb730931b540 (patch) | |
tree | 3019798399bb7c952ff0f925189b33863a90e674 /ext/misc/json1.c | |
parent | 2c885d0575cbe6f2a7ad45cd4a631e1a359b5b00 (diff) | |
download | sqlite-fd4b72853ae8811741d060d413c6eb730931b540.tar.gz sqlite-fd4b72853ae8811741d060d413c6eb730931b540.zip |
Add ALWAYS() macros on results of sqlite3_aggregate_context() calls in
xInverse() implements, since they can never fail.
FossilOrigin-Name: fdef2a921d451c66ca535021d08af3ec1ab53283da2d2979378a799fd8731ef9
Diffstat (limited to 'ext/misc/json1.c')
-rw-r--r-- | ext/misc/json1.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/misc/json1.c b/ext/misc/json1.c index 398dd465c..f4f3507eb 100644 --- a/ext/misc/json1.c +++ b/ext/misc/json1.c @@ -1848,7 +1848,9 @@ static void jsonGroupInverse( char *z; JsonString *pStr; pStr = (JsonString*)sqlite3_aggregate_context(ctx, 0); - if( !pStr ) return; + /* pStr is always non-NULL since jsonArrayStep() or jsonObjectStep() will + ** always have been called to initalize it */ + if( NEVER(!pStr) ) return; z = pStr->zBuf; for(i=1; z[i]!=',' || inStr; i++){ assert( i<pStr->nUsed ); |