aboutsummaryrefslogtreecommitdiff
path: root/tool/lempar.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-08-28 02:09:47 +0000
committerdrh <drh@noemail.net>2019-08-28 02:09:47 +0000
commit2e51716b1520fc6e681e9578d681e2e60ae6590f (patch)
tree2a5a46b7e58ecf23d4c4c5179a8f981817a5137b /tool/lempar.c
parent8085d53d3c5f853c592cb2ffdb7e49a219c962be (diff)
downloadsqlite-2e51716b1520fc6e681e9578d681e2e60ae6590f.tar.gz
sqlite-2e51716b1520fc6e681e9578d681e2e60ae6590f.zip
Increase the size of the yy_lookahead table so that it is never necessary to
down bounds checking on the index. FossilOrigin-Name: bafd872398e58766e996963372c7acc03a1e20a6d39a3867ca45d3ea0ed2ac1d
Diffstat (limited to 'tool/lempar.c')
-rw-r--r--tool/lempar.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tool/lempar.c b/tool/lempar.c
index 1c088080d..baf6a217d 100644
--- a/tool/lempar.c
+++ b/tool/lempar.c
@@ -521,11 +521,13 @@ static YYACTIONTYPE yy_find_shift_action(
do{
i = yy_shift_ofst[stateno];
assert( i>=0 );
- /* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
+ assert( i<=YY_ACTTAB_COUNT );
+ assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD );
assert( iLookAhead!=YYNOCODE );
assert( iLookAhead < YYNTOKEN );
i += iLookAhead;
- if( i>=YY_NLOOKAHEAD || yy_lookahead[i]!=iLookAhead ){
+ assert( i<(int)YY_NLOOKAHEAD );
+ if( yy_lookahead[i]!=iLookAhead ){
#ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */
if( iLookAhead<sizeof(yyFallback)/sizeof(yyFallback[0])