/* Report an out-of-memory (OOM) condition
*/
static void jsonOom(JsonString *p){
- if( !p->bErr ){
- p->bErr = 1;
- sqlite3_result_error_nomem(p->pCtx);
- jsonReset(p);
- }
+ p->bErr = 1;
+ sqlite3_result_error_nomem(p->pCtx);
+ jsonReset(p);
}
/* Enlarge pJson->zBuf so that it can hold at least N more bytes.
JsonNode *pNew;
if( pParse->oom ) return -1;
nNew = pParse->nAlloc*2 + 10;
- if( nNew<=pParse->nNode ){
- pParse->oom = 1;
- return -1;
- }
pNew = sqlite3_realloc(pParse->aNode, sizeof(JsonNode)*nNew);
if( pNew==0 ){
pParse->oom = 1;
}else if( zPath[0]=='[' && safe_isdigit(zPath[1]) ){
if( pRoot->eType!=JSON_ARRAY ) return 0;
i = 0;
- zPath++;
- while( safe_isdigit(zPath[0]) ){
- i = i*10 + zPath[0] - '0';
- zPath++;
+ j = 1;
+ while( safe_isdigit(zPath[j]) ){
+ i = i*10 + zPath[j] - '0';
+ j++;
}
- if( zPath[0]!=']' ){
+ if( zPath[j]!=']' ){
*pzErr = zPath;
return 0;
}
- zPath++;
+ zPath += j + 1;
j = 1;
for(;;){
while( j<=pRoot->n && (i>0 || (pRoot[j].jnFlags & JNODE_REMOVE)!=0) ){
}
return pNode;
}
- }else if( zPath[0]!=0 ){
+ }else{
*pzErr = zPath;
}
return 0;
sqlite3_result_text(ctx, zRoot, -1, SQLITE_STATIC);
break;
}
- default: {
+ case JEACH_JSON: {
assert( i==JEACH_JSON );
sqlite3_result_text(ctx, p->sParse.zJson, -1, SQLITE_STATIC);
break;
pNode->u.iKey = 0;
p->iEnd = p->i + pNode->n + 1;
if( p->bRecursive ){
+ p->eType = p->sParse.aNode[p->sParse.aUp[p->i]].eType;
if( p->i>0 && (p->sParse.aNode[p->i-1].jnFlags & JNODE_LABEL)!=0 ){
p->i--;
}
-C Fix\sjson_set()\sso\sthat\sit\scan\soverwrite\sa\svalue\sthat\swas\spreviously\soverwritten\nduring\sthe\ssame\scall.
-D 2015-09-22T00:21:03.350
+C Futher\ssimplifications\sto\sjson1.c.\s\sAlso\san\sobscure\sbug-fix\sin\sthe\sinitial\noutput\sof\sjson_tree()\swhen\susing\sa\spath\sto\san\sobject\scontained\swithin\san\sarray.
+D 2015-09-22T01:15:49.994
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2047811644c5bac91ccdfc2720e49b60965a63a7
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
F ext/misc/fuzzer.c 4c84635c71c26cfa7c2e5848cf49fe2d2cfcd767
F ext/misc/ieee754.c b0362167289170627659e84173f5d2e8fee8566e
-F ext/misc/json1.c c5e7018b8fe23ba778a24d918724b5963ecaa689
+F ext/misc/json1.c 8eefcbdc172e9eff3c613016260c2d82893c12f2
F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
F ext/misc/regexp.c af92cdaa5058fcec1451e49becc7ba44dba023dc
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 737ac3faf4e5fcb5855f5f9a1c1ddfc5424e6292
-R 95f992a7687b0db3b0df98a691005bc0
+P 0f16041647993975c316203c7e11f06e27640136
+R 062ca531bf3a825489a40d6145bed1f2
U drh
-Z 7a61ae480ab77880b942dd9dc8577d84
+Z 6b7ed4fd95fc512864c2dd577eb1b3dd
-0f16041647993975c316203c7e11f06e27640136
\ No newline at end of file
+fcb1e327a64134e5ac539ec3d52733422d3061fd
\ No newline at end of file