-C Further\simprovements\sto\sthe\sfuzzer.\s\sIt\sstill\sis\snot\squite\sworking.\s\sPausing\nto\swork\son\sother\sthings....
-D 2011-03-29T14:08:09.188
+C The\sfirst\ssimple\stest-case\sappears\sto\sbe\sworking\snow.
+D 2011-03-29T18:21:59.753
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 6c96e694f446500449f683070b906de9fce17b88
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/test_demovfs.c 0aed671636735116fc872c5b03706fd5612488b5
F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
F src/test_func.c cbdec5cededa0761daedde5baf06004a9bf416b5
-F src/test_fuzzer.c 3e402dd5e6c4f096fdc92c52e775e8fad85bce9b
+F src/test_fuzzer.c 1427f9b54dbb6fa4742bd611adcd9b0abedfc083
F src/test_hexio.c 1237f000ec7a491009b1233f5c626ea71bce1ea2
F src/test_init.c 5d624ffd0409d424cf9adbfe1f056b200270077c
F src/test_intarray.c d879bbf8e4ce085ab966d1f3c896a7c8b4f5fc99
F test/fuzz3.test aec64345184d1662bd30e6a17851ff659d596dc5
F test/fuzz_common.tcl a87dfbb88c2a6b08a38e9a070dabd129e617b45b
F test/fuzz_malloc.test dd7001ac86d09c154a7dff064f4739c60e2b312c
-F test/fuzzer1.test a5d60f618443b86b5f5a695a41d01b7d8697345d
+F test/fuzzer1.test a81a50d7ba6005d9cc98bf58b8aae8c3e73e11a6
F test/hook.test f04c3412463f8ec117c1c704c74ca0f627ce733a
F test/icu.test 70df4faca133254c042d02ae342c0a141f2663f4
F test/in.test 19b642bb134308980a92249750ea4ce3f6c75c2d
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P fb4c31eac8a7290f61c50a3552245660e1271871
-R 86b6649d084e41c015babc3a0e3fb294
+P 5f2f2fce40f43debeb0492c9b460b85c7dad2bde
+R 1ce7df4d179ed6c133db387973d1e6f3
U drh
-Z 67d6460bdc70fd366585e4c8607ab8f4
+Z 6cf1874f37d2b9758d183fd9153a451e
}
n = pStem->n;
z = *pzBuf;
- memcpy(z, pStem->zBasis, n);
- memcpy(&z[n], pRule->zTo, pRule->nTo);
- memcpy(&z[n+pRule->nTo], &pStem->zBasis[n+pRule->nFrom],
- pStem->nBasis-n-pRule->nFrom+1);
+ if( n<0 ){
+ memcpy(z, pStem->zBasis, pStem->nBasis+1);
+ }else{
+ memcpy(z, pStem->zBasis, n);
+ memcpy(&z[n], pRule->zTo, pRule->nTo);
+ memcpy(&z[n+pRule->nTo], &pStem->zBasis[n+pRule->nFrom],
+ pStem->nBasis-n-pRule->nFrom+1);
+ }
return SQLITE_OK;
}
-
/*
** Compute a hash on zBasis.
*/
return pStem->rBaseCost + pStem->pRule->rCost;
}
+#if 0
+/*
+** Print a description of a fuzzer_stem on stderr.
+*/
+static void fuzzerStemPrint(
+ const char *zPrefix,
+ fuzzer_stem *pStem,
+ const char *zSuffix
+){
+ if( pStem->n<0 ){
+ fprintf(stderr, "%s[%s](%d)-->self%s",
+ zPrefix,
+ pStem->zBasis, pStem->rBaseCost,
+ zSuffix
+ );
+ }else{
+ char *zBuf = 0;
+ int nBuf = 0;
+ if( fuzzerRender(pStem, &zBuf, &nBuf)!=SQLITE_OK ) return;
+ fprintf(stderr, "%s[%s](%d)-->{%s}(%d)%s",
+ zPrefix,
+ pStem->zBasis, pStem->rBaseCost, zBuf, fuzzerCost(pStem),
+ zSuffix
+ );
+ sqlite3_free(zBuf);
+ }
+}
+#endif
+
/*
** Return 1 if the string to which the cursor is point has already
** been emitted. Return 0 if not. Return -1 on a memory allocation
/* Found a rewrite case. Make sure it is not a duplicate */
int rc = fuzzerSeen(pCur, pStem);
if( rc<0 ) return -1;
- if( rc==0 ) return 1;
+ if( rc==0 ){
+ return 1;
+ }
}
}
pStem->n = -1;
*/
while( (pStem = pCur->pStem)!=0 ){
if( fuzzerAdvance(pCur, pStem) ){
- pCur->pStem = fuzzerInsert(pStem->pNext, pStem);
- if( pCur->pStem!=pStem && (rc = fuzzerSeen(pCur, pStem))!=0 ){
+ pCur->pStem = pStem = fuzzerInsert(pStem->pNext, pStem);
+ if( (rc = fuzzerSeen(pCur, pStem))!=0 ){
if( rc<0 ) return SQLITE_NOMEM;
continue;
- }else{
- return SQLITE_OK; /* New word found */
}
+ return SQLITE_OK; /* New word found */
}
pCur->pStem = pStem->pNext;
pStem->pNext = pCur->pDone;
pCur->pDone = pStem;
+ if( pCur->pStem ){
+ rc = fuzzerSeen(pCur, pCur->pStem);
+ if( rc<0 ) return SQLITE_NOMEM;
+ if( rc==0 ){
+ return SQLITE_OK;
+ }
+ }
}
/* Reach this point only if queue has been exhausted and there is