/ Check-in [e3064ba3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix an unreachable branch associated with stack overflow in the LEMON-generated parser.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e3064ba3b68ca2a1c54561756e8c898866a19ef6e785d315171cd47827a50c85
User & Date: drh 2018-04-23 00:25:31
Context
2018-04-23
13:28
Ensure that there are no bind-parameters or incorrect schema references in the UPSERT portions of an INSERT within a TRIGGER. check-in: d47a6bdd user: drh tags: trunk
00:25
Fix an unreachable branch associated with stack overflow in the LEMON-generated parser. check-in: e3064ba3 user: drh tags: trunk
2018-04-21
22:40
Performance improvements on the main loop of the LEMON-generated parser. check-in: fec1ebad user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/lempar.c.

   743    743         yypParser->yyhwm++;
   744    744         assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
   745    745       }
   746    746   #endif
   747    747   #if YYSTACKDEPTH>0 
   748    748       if( yypParser->yytos>=yypParser->yystackEnd ){
   749    749         yyStackOverflow(yypParser);
   750         -      return YY_ACCEPT_ACTION;
          750  +      /* The call to yyStackOverflow() above pops the stack until it is
          751  +      ** empty, causing the main parser loop to exit.  So the return value
          752  +      ** is never used and does not matter. */
          753  +      return 0;
   751    754       }
   752    755   #else
   753    756       if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
   754    757         if( yyGrowStack(yypParser) ){
   755    758           yyStackOverflow(yypParser);
   756         -        return YY_ACCEPT_ACTION;
          759  +        /* The call to yyStackOverflow() above pops the stack until it is
          760  +        ** empty, causing the main parser loop to exit.  So the return value
          761  +        ** is never used and does not matter. */
          762  +        return 0;
   757    763         }
   758    764         yymsp = yypParser->yytos;
   759    765       }
   760    766   #endif
   761    767     }
   762    768   
   763    769     switch( yyruleno ){
................................................................................
   926    932       }else if( yyact <= YY_MAX_SHIFTREDUCE ){
   927    933         yy_shift(yypParser,yyact,yymajor,yyminor);
   928    934   #ifndef YYNOERRORRECOVERY
   929    935         yypParser->yyerrcnt--;
   930    936   #endif
   931    937         break;
   932    938       }else if( yyact==YY_ACCEPT_ACTION ){
   933         -      /* YY_ACCEPT_ACTION also happens on a stack overflow.  We distingush
   934         -      ** the two cases by observing that on a true accept, there should be
   935         -      ** a single token left on the stack, whereas on a stack overflow,
   936         -      ** the stack has been popped (by yyStackOverflow()) to be empty */
   937         -      if( yypParser->yytos > yypParser->yystack ){
   938         -        yypParser->yytos--;
   939         -        yy_accept(yypParser);
   940         -      }
          939  +      yypParser->yytos--;
          940  +      yy_accept(yypParser);
   941    941         return;
   942    942       }else{
   943    943         assert( yyact == YY_ERROR_ACTION );
   944    944         yyminorunion.yy0 = yyminor;
   945    945   #ifdef YYERRORSYMBOL
   946    946         int yymx;
   947    947   #endif