/ Check-in [7113b5ed]
Login

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

Overview
Comment:Fix a bug in lemon that does not effect SQLite. Ticket #1068. (CVS 2208)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7113b5ed8d51718356ce1cc51896a3070875a7e2
User & Date: drh 2005-01-13 23:54:07
Context
2005-01-13
23:54
Need SQLITE_MEMDEBUG instead of SQLITE_DEBUG in tclsqlite.c. (CVS 2209) check-in: 6e905270 user: drh tags: trunk
23:54
Fix a bug in lemon that does not effect SQLite. Ticket #1068. (CVS 2208) check-in: 7113b5ed user: drh tags: trunk
13:35
Tidy up malloc.test a bit. (CVS 2207) check-in: 94cf91cc user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to tool/lemon.c.

  3659   3659         fprintf(out,"    case %d:\n",sp->index); lineno++;
  3660   3660       }
  3661   3661       for(i=0; i<lemp->nsymbol && lemp->symbols[i]->type!=TERMINAL; i++);
  3662   3662       if( i<lemp->nsymbol ){
  3663   3663         emit_destructor_code(out,lemp->symbols[i],lemp,&lineno);
  3664   3664         fprintf(out,"      break;\n"); lineno++;
  3665   3665       }
         3666  +  }
         3667  +  if( lemp->vardest ){
         3668  +    struct symbol *dflt_sp = 0;
         3669  +    for(i=0; i<lemp->nsymbol; i++){
         3670  +      struct symbol *sp = lemp->symbols[i];
         3671  +      if( sp==0 || sp->type==TERMINAL ||
         3672  +          sp->index<=0 || sp->destructor!=0 ) continue;
         3673  +      fprintf(out,"    case %d:\n",sp->index); lineno++;
         3674  +      dflt_sp = sp;
         3675  +    }
         3676  +    if( dflt_sp!=0 ){
         3677  +      emit_destructor_code(out,dflt_sp,lemp,&lineno);
         3678  +      fprintf(out,"      break;\n"); lineno++;
         3679  +    }
  3666   3680     }
  3667   3681     for(i=0; i<lemp->nsymbol; i++){
  3668   3682       struct symbol *sp = lemp->symbols[i];
  3669   3683       if( sp==0 || sp->type==TERMINAL || sp->destructor==0 ) continue;
  3670   3684       fprintf(out,"    case %d:\n",sp->index); lineno++;
  3671   3685   
  3672   3686       /* Combine duplicate destructors into a single case */
................................................................................
  3679   3693            sp2->destructor = 0;
  3680   3694         }
  3681   3695       }
  3682   3696   
  3683   3697       emit_destructor_code(out,lemp->symbols[i],lemp,&lineno);
  3684   3698       fprintf(out,"      break;\n"); lineno++;
  3685   3699     }
  3686         -  if( lemp->vardest ){
  3687         -    struct symbol *dflt_sp = 0;
  3688         -    for(i=0; i<lemp->nsymbol; i++){
  3689         -      struct symbol *sp = lemp->symbols[i];
  3690         -      if( sp==0 || sp->type==TERMINAL ||
  3691         -          sp->index<=0 || sp->destructor!=0 ) continue;
  3692         -      fprintf(out,"    case %d:\n",sp->index); lineno++;
  3693         -      dflt_sp = sp;
  3694         -    }
  3695         -    if( dflt_sp!=0 ){
  3696         -      emit_destructor_code(out,dflt_sp,lemp,&lineno);
  3697         -      fprintf(out,"      break;\n"); lineno++;
  3698         -    }
  3699         -  }
  3700   3700     tplt_xfer(lemp->name,in,out,&lineno);
  3701   3701   
  3702   3702     /* Generate code which executes whenever the parser stack overflows */
  3703   3703     tplt_print(out,lemp,lemp->overflow,lemp->overflowln,&lineno);
  3704   3704     tplt_xfer(lemp->name,in,out,&lineno);
  3705   3705   
  3706   3706     /* Generate the table of rule information