From: drh Date: Wed, 27 Dec 2017 15:21:16 +0000 (+0000) Subject: In LEMON, fix an off-by-one error that can make the lookahead table one X-Git-Tag: version-3.22.0~127^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4396c61959eda774c250f50a2dc36f840658abda;p=thirdparty%2Fsqlite.git In LEMON, fix an off-by-one error that can make the lookahead table one byte too smal. FossilOrigin-Name: 93792bc58a2eccc7e07b14307388350bb376db32c5055b79a44e4fa8ff91d58e --- diff --git a/manifest b/manifest index ffec829b50..784faa63b2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Change\sthe\slemon-parser\scoverage\sreport\sformat\sto\sreport\sall\sstate/lookahead\npairs\sand\sindicate\son\seach\swhether\sit\sis\shit\sor\smissed. -D 2017-12-26T18:32:06.041 +C In\sLEMON,\sfix\san\soff-by-one\serror\sthat\scan\smake\sthe\slookahead\stable\sone\nbyte\stoo\ssmal. +D 2017-12-27T15:21:16.478 F Makefile.in ceb40bfcb30ebba8e1202b34c56ff7e13e112f9809e2381d99be32c2726058f5 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 6480671f7c129e61208d69492b3c71ce4310d49fceac83cfb17f1c081e242b69 @@ -1608,7 +1608,7 @@ F tool/genfkey.README cf68fddd4643bbe3ff8e31b8b6d8b0a1b85e20f4 F tool/genfkey.test 4196a8928b78f51d54ef58e99e99401ab2f0a7e5 F tool/getlock.c f4c39b651370156cae979501a7b156bdba50e7ce F tool/kvtest-speed.sh 4761a9c4b3530907562314d7757995787f7aef8f -F tool/lemon.c d92031adf63377ff5055441c9d26a41a03378e8cac8dbcc1cd6ef7190f51aa6a +F tool/lemon.c 7f7735326ca9c3b48327b241063cee52d35d44e20ebe1b3624a81658052a4d39 F tool/lempar.c 64e760f7cc21ea7e73513b062a86a3c478dfd1ed41fe9837a6f49958cdb61e03 F tool/libvers.c caafc3b689638a1d88d44bc5f526c2278760d9b9 F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862 @@ -1687,7 +1687,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P d76e12066fa6950f877cbe33b1892e2b0afa948978815d5b9a90cde1fff8ec98 -R 930f1a264ff138489be35924f879ef78 +P 86e30fc284c740b55f75884b67988fe837b28878f586f6ec8850ecf80164e700 +R 4a4c12385039bdde527999ce093c45db U drh -Z 2620b1a658dd06210670b65491310e1c +Z dbb131aa448f925318d1af4566b5714c diff --git a/manifest.uuid b/manifest.uuid index 97230d7170..d4b1dea234 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -86e30fc284c740b55f75884b67988fe837b28878f586f6ec8850ecf80164e700 \ No newline at end of file +93792bc58a2eccc7e07b14307388350bb376db32c5055b79a44e4fa8ff91d58e \ No newline at end of file diff --git a/tool/lemon.c b/tool/lemon.c index 111082c72a..96bbed7473 100644 --- a/tool/lemon.c +++ b/tool/lemon.c @@ -766,7 +766,7 @@ int acttab_insert(acttab *p, int makeItSafe){ p->aAction[k] = p->aLookahead[j]; if( k>=p->nAction ) p->nAction = k+1; } - if( makeItSafe && i+p->nterminal>p->nAction ) p->nAction = i+p->nterminal; + if( makeItSafe && i+p->nterminal>=p->nAction ) p->nAction = i+p->nterminal+1; p->nLookahead = 0; /* Return the offset that is added to the lookahead in order to get the