SQLite

Check-in [e3064ba3b6]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: e3064ba3b68ca2a1c54561756e8c898866a19ef6e785d315171cd47827a50c85
User & Date: drh 2018-04-23 00:25:31.966
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: d47a6bdda0 user: drh tags: trunk)
00:25
Fix an unreachable branch associated with stack overflow in the LEMON-generated parser. (check-in: e3064ba3b6 user: drh tags: trunk)
2018-04-21
22:40
Performance improvements on the main loop of the LEMON-generated parser. (check-in: fec1ebadeb user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to tool/lempar.c.
743
744
745
746
747
748
749



750
751
752
753
754
755



756
757
758
759
760
761
762
763
      yypParser->yyhwm++;
      assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
    }
#endif
#if YYSTACKDEPTH>0 
    if( yypParser->yytos>=yypParser->yystackEnd ){
      yyStackOverflow(yypParser);



      return YY_ACCEPT_ACTION;
    }
#else
    if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
      if( yyGrowStack(yypParser) ){
        yyStackOverflow(yypParser);



        return YY_ACCEPT_ACTION;
      }
      yymsp = yypParser->yytos;
    }
#endif
  }

  switch( yyruleno ){







>
>
>
|





>
>
>
|







743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
      yypParser->yyhwm++;
      assert( yypParser->yyhwm == (int)(yypParser->yytos - yypParser->yystack));
    }
#endif
#if YYSTACKDEPTH>0 
    if( yypParser->yytos>=yypParser->yystackEnd ){
      yyStackOverflow(yypParser);
      /* The call to yyStackOverflow() above pops the stack until it is
      ** empty, causing the main parser loop to exit.  So the return value
      ** is never used and does not matter. */
      return 0;
    }
#else
    if( yypParser->yytos>=&yypParser->yystack[yypParser->yystksz-1] ){
      if( yyGrowStack(yypParser) ){
        yyStackOverflow(yypParser);
        /* The call to yyStackOverflow() above pops the stack until it is
        ** empty, causing the main parser loop to exit.  So the return value
        ** is never used and does not matter. */
        return 0;
      }
      yymsp = yypParser->yytos;
    }
#endif
  }

  switch( yyruleno ){
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
    }else if( yyact <= YY_MAX_SHIFTREDUCE ){
      yy_shift(yypParser,yyact,yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
      yypParser->yyerrcnt--;
#endif
      break;
    }else if( yyact==YY_ACCEPT_ACTION ){
      /* YY_ACCEPT_ACTION also happens on a stack overflow.  We distingush
      ** the two cases by observing that on a true accept, there should be
      ** a single token left on the stack, whereas on a stack overflow,
      ** the stack has been popped (by yyStackOverflow()) to be empty */
      if( yypParser->yytos > yypParser->yystack ){
        yypParser->yytos--;
        yy_accept(yypParser);
      }
      return;
    }else{
      assert( yyact == YY_ERROR_ACTION );
      yyminorunion.yy0 = yyminor;
#ifdef YYERRORSYMBOL
      int yymx;
#endif







<
<
<
<
<
|
|
<







932
933
934
935
936
937
938





939
940

941
942
943
944
945
946
947
    }else if( yyact <= YY_MAX_SHIFTREDUCE ){
      yy_shift(yypParser,yyact,yymajor,yyminor);
#ifndef YYNOERRORRECOVERY
      yypParser->yyerrcnt--;
#endif
      break;
    }else if( yyact==YY_ACCEPT_ACTION ){





      yypParser->yytos--;
      yy_accept(yypParser);

      return;
    }else{
      assert( yyact == YY_ERROR_ACTION );
      yyminorunion.yy0 = yyminor;
#ifdef YYERRORSYMBOL
      int yymx;
#endif