/ Check-in [4424aee9]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix a segfault in Lemon that occurs if the input grammar does not define a type for tokens. This does not effect SQLite since the SQLite grammar does define a type for tokens. (CVS 6451)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4424aee958b2e764a61141b5c66c063e36ed5aae
User & Date: drh 2009-04-05 15:18:03
Context
2009-04-06
11:11
Check-in (6450) introduced the possibility of calling memset() with a negative 3rd argument. This fixes that bug. Ticket #3777. (CVS 6452) check-in: 8ca612c4 user: drh tags: trunk
2009-04-05
15:18
Fix a segfault in Lemon that occurs if the input grammar does not define a type for tokens. This does not effect SQLite since the SQLite grammar does define a type for tokens. (CVS 6451) check-in: 4424aee9 user: drh tags: trunk
12:22
Additional code to make sure and to assert that memory allocations have 8-byte alignment. Ticket #3777. (CVS 6450) check-in: 208382e0 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tool/lemon.c.

3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
    cp = sp->datatype;
    if( cp==0 ) cp = lemp->vartype;
    j = 0;
    while( isspace(*cp) ) cp++;
    while( *cp ) stddt[j++] = *cp++;
    while( j>0 && isspace(stddt[j-1]) ) j--;
    stddt[j] = 0;
    if( strcmp(stddt, lemp->tokentype)==0 ){
      sp->dtnum = 0;
      continue;
    }
    hash = 0;
    for(j=0; stddt[j]; j++){
      hash = hash*53 + stddt[j];
    }







|







3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
    cp = sp->datatype;
    if( cp==0 ) cp = lemp->vartype;
    j = 0;
    while( isspace(*cp) ) cp++;
    while( *cp ) stddt[j++] = *cp++;
    while( j>0 && isspace(stddt[j-1]) ) j--;
    stddt[j] = 0;
    if( lemp->tokentype && strcmp(stddt, lemp->tokentype)==0 ){
      sp->dtnum = 0;
      continue;
    }
    hash = 0;
    for(j=0; stddt[j]; j++){
      hash = hash*53 + stddt[j];
    }