]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a bug in lemon in computation of which non-terminals can generate an
authordrh <drh@noemail.net>
Sat, 7 Jan 2012 15:17:18 +0000 (15:17 +0000)
committerdrh <drh@noemail.net>
Sat, 7 Jan 2012 15:17:18 +0000 (15:17 +0000)
empty string.  This bug and the fix make absolutely no difference for the
grammar used by SQLite, but it can make a difference when lemon is used
in other grammars.

FossilOrigin-Name: ce32775b232da894343f62deefaf19b0ec484636

manifest
manifest.uuid
tool/lemon.c

index ec1d1560bbe2ed050bb97aa47b4b907c87a9ee5d..ec605235a85f601745030b7bba57919111029918 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Add\smissing\sfinish_test\sto\sthe\send\sof\sthe\szerodamage.test\smodule.\s\sDisable\nthe\szerodamage\smodule\sif\svirtual\stables\sare\somitted\sfrom\sthe\sbuild.
-D 2012-01-06T13:58:04.857
+C Fix\sa\sbug\sin\slemon\sin\scomputation\sof\swhich\snon-terminals\scan\sgenerate\san\nempty\sstring.\s\sThis\sbug\sand\sthe\sfix\smake\sabsolutely\sno\sdifference\sfor\sthe\ngrammar\sused\sby\sSQLite,\sbut\sit\scan\smake\sa\sdifference\swhen\slemon\sis\sused\nin\sother\sgrammars.
+D 2012-01-07T15:17:18.449
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 5b4a3e12a850b021547e43daf886b25133b44c07
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -949,7 +949,7 @@ F tool/fragck.tcl 5265a95126abcf6ab357f7efa544787e5963f439
 F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4
 F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5
 F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce
-F tool/lemon.c 949328f67cac94969d3112b105b8457edf27f44e
+F tool/lemon.c b6a92ac052f574046666d0c450806b15e579730b
 F tool/lempar.c 01ca97f87610d1dac6d8cd96ab109ab1130e76dc
 F tool/mkkeywordhash.c d2e6b4a5965e23afb80fbe74bb54648cd371f309
 F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
@@ -986,7 +986,7 @@ F tool/tostr.awk e75472c2f98dd76e06b8c9c1367f4ab07e122d06
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
 F tool/warnings-clang.sh 9f406d66e750e8ac031c63a9ef3248aaa347ef2a
 F tool/warnings.sh fbc018d67fd7395f440c28f33ef0f94420226381
-P 119493318e0ad4c2858fe1484b0d71669bd81531
-R 12ca6aee48cd7ee8bacfbe37c52ebf0f
+P d2a5685b5e282488df382fc210e4f0d786259658
+R a1466c1ec4ac2f5126c364ef99bb649f
 U drh
-Z bb27892dfc871497436b04576e485c46
+Z bae7f4927646cf8baf17cbd773e91bac
index 3192c3aecae41b2f8a63b4ac2af5755fadb375e9..ac7a2ce4050ffd16ffb5f59d1d3aba46cf2205a4 100644 (file)
@@ -1 +1 @@
-d2a5685b5e282488df382fc210e4f0d786259658
\ No newline at end of file
+ce32775b232da894343f62deefaf19b0ec484636
\ No newline at end of file
index 1fb0308bec6db2473879eb4da96b84366e19c22f..a089bc7ba85316c9951594e4e6276f54ebbce996 100644 (file)
@@ -686,8 +686,9 @@ void FindFirstSets(struct lemon *lemp)
     for(rp=lemp->rule; rp; rp=rp->next){
       if( rp->lhs->lambda ) continue;
       for(i=0; i<rp->nrhs; i++){
-         struct symbol *sp = rp->rhs[i];
-         if( sp->type!=TERMINAL || sp->lambda==LEMON_FALSE ) break;
+        struct symbol *sp = rp->rhs[i];
+        assert( sp->type==NONTERMINAL || sp->lambda==LEMON_FALSE );
+        if( sp->lambda==LEMON_FALSE ) break;
       }
       if( i==rp->nrhs ){
         rp->lhs->lambda = LEMON_TRUE;