/ Check-in [f2ad230f]
Login

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

Overview
Comment:Fix a bug in lemon that leads to an assertion fault given an invalid grammar. The bug and this fix do not effect on SQLite. Ticket #2107. (CVS 3528)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f2ad230f6dce98d664370d77845b5f585de20f08
User & Date: drh 2006-12-14 01:06:22
Context
2006-12-16
16:25
Query optimizer enhancement: In "FROM a,b,c left join d" allow the C table to be reordered with A and B. This used to be the case but the capability was removed by (3203) and (3052) in response to ticket #1652. This change restores the capability. (CVS 3529) check-in: 7393c81b user: drh tags: trunk
2006-12-14
01:06
Fix a bug in lemon that leads to an assertion fault given an invalid grammar. The bug and this fix do not effect on SQLite. Ticket #2107. (CVS 3528) check-in: f2ad230f user: drh tags: trunk
2006-11-30
13:06
Change the table_info pragma so that it returns NULL for the default value if there is no default value. Ticket #2078. (CVS 3527) check-in: 5f21c3a5 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/lemon.c.

   357    357   struct action *ap1;
   358    358   struct action *ap2;
   359    359   {
   360    360     int rc;
   361    361     rc = ap1->sp->index - ap2->sp->index;
   362    362     if( rc==0 ) rc = (int)ap1->type - (int)ap2->type;
   363    363     if( rc==0 ){
   364         -    assert( ap1->type==REDUCE || ap1->type==RD_RESOLVED || ap1->type==CONFLICT);
   365         -    assert( ap2->type==REDUCE || ap2->type==RD_RESOLVED || ap2->type==CONFLICT);
   366    364       rc = ap1->x.rp->index - ap2->x.rp->index;
   367    365     }
   368    366     return rc;
   369    367   }
   370    368   
   371    369   /* Sort parser actions */
   372    370   struct action *Action_sort(ap)
................................................................................
  1015   1013   struct action *apx;
  1016   1014   struct action *apy;
  1017   1015   struct symbol *errsym;   /* The error symbol (if defined.  NULL otherwise) */
  1018   1016   {
  1019   1017     struct symbol *spx, *spy;
  1020   1018     int errcnt = 0;
  1021   1019     assert( apx->sp==apy->sp );  /* Otherwise there would be no conflict */
         1020  +  if( apx->type==SHIFT && apy->type==SHIFT ){
         1021  +    apy->type = CONFLICT;
         1022  +    errcnt++;
         1023  +  }
  1022   1024     if( apx->type==SHIFT && apy->type==REDUCE ){
  1023   1025       spx = apx->sp;
  1024   1026       spy = apy->x.rp->precsym;
  1025   1027       if( spy==0 || spx->prec<0 || spy->prec<0 ){
  1026   1028         /* Not enough precedence information. */
  1027   1029         apy->type = CONFLICT;
  1028   1030         errcnt++;