/ Check-in [d9c9fe9f]
Login

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

Overview
Comment:Fix an overzealous assert() statement discovered by OSSFuzz.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:d9c9fe9f5ad3fc9123ad29ebafcb7f40dcecd448fb7a928bb31bea8181d81ec1
User & Date: drh 2018-08-06 01:21:53
Context
2018-08-06
01:39
Add the --info option to the fuzzcheck test utility. check-in: 1caaaaa7 user: drh tags: trunk
01:21
Fix an overzealous assert() statement discovered by OSSFuzz. check-in: d9c9fe9f user: drh tags: trunk
2018-08-04
20:30
Remove the column-cache from the code generator. The column-cache has been a persistent source of bugs for years and with recent improvements in the performance of OP_Column, it no longer provides a benefit. After the column cache is removed, the binary is almost 2KB smaller and the speed-check.sh performance test is over 3 million cycles faster. check-in: cdff3af7 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

  1908   1908   case OP_Gt:               /* same as TK_GT, jump, in1, in3 */
  1909   1909   case OP_Ge: {             /* same as TK_GE, jump, in1, in3 */
  1910   1910     int res, res2;      /* Result of the comparison of pIn1 against pIn3 */
  1911   1911     char affinity;      /* Affinity to use for comparison */
  1912   1912     u16 flags1;         /* Copy of initial value of pIn1->flags */
  1913   1913     u16 flags3;         /* Copy of initial value of pIn3->flags */
  1914   1914   
  1915         -  /* The only way for P1 and P3 to be the same is when comparing constants.
  1916         -  ** But in that case, the affinities will always be SQLITE_AFF_BLOB or none */
  1917         -  assert( pOp->p1!=pOp->p3 || (pOp->p5 & SQLITE_AFF_MASK)<=SQLITE_AFF_BLOB );
  1918         -  testcase( pOp->p1==pOp->p3 );
  1919         -
  1920   1915     pIn1 = &aMem[pOp->p1];
  1921   1916     pIn3 = &aMem[pOp->p3];
  1922   1917     flags1 = pIn1->flags;
  1923   1918     flags3 = pIn3->flags;
  1924   1919     if( (flags1 | flags3)&MEM_Null ){
  1925   1920       /* One or both operands are NULL */
  1926   1921       if( pOp->p5 & SQLITE_NULLEQ ){
................................................................................
  1960   1955     }else{
  1961   1956       /* Neither operand is NULL.  Do a comparison. */
  1962   1957       affinity = pOp->p5 & SQLITE_AFF_MASK;
  1963   1958       if( affinity>=SQLITE_AFF_NUMERIC ){
  1964   1959         if( (flags1 | flags3)&MEM_Str ){
  1965   1960           if( (flags1 & (MEM_Int|MEM_Real|MEM_Str))==MEM_Str ){
  1966   1961             applyNumericAffinity(pIn1,0);
         1962  +          assert( flags3==pIn3->flags );
  1967   1963             /* testcase( flags3!=pIn3->flags );
  1968   1964             ** this used to be possible with pIn1==pIn3, but not since
  1969   1965             ** the column cache was removed.  The following assignment
  1970         -          ** is essentially a no-op.  But, it prevents defense-in-depth
         1966  +          ** is essentially a no-op.  But, it provides defense-in-depth
  1971   1967             ** in case our analysis is incorrect, so it is left in. */
  1972   1968             flags3 = pIn3->flags;
  1973   1969           }
  1974   1970           if( (flags3 & (MEM_Int|MEM_Real|MEM_Str))==MEM_Str ){
  1975   1971             applyNumericAffinity(pIn3,0);
  1976   1972           }
  1977   1973         }

Changes to test/fuzzdata4.db.

cannot compute difference between binary files