/ Check-in [86944f19]
Login

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

Overview
Comment:Fix two harmless compiler warnings about comparisons of dangling pointers.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 86944f193f1f06b64471953bb5713ecea7f3d803
User & Date: drh 2016-01-19 17:54:21
Context
2016-01-19
21:36
Fix an incorrect VFS version number check in the threadtest3.c test program. check-in: 5bf6442b user: drh tags: trunk
17:54
Fix two harmless compiler warnings about comparisons of dangling pointers. check-in: 86944f19 user: drh tags: trunk
16:06
Add further fts5 tests. 100% code coverage is finally restored. check-in: b914ece0 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

  3651   3651       sqlite3VdbeMemShallowCopy(&c1, pMem1, MEM_Ephem);
  3652   3652       sqlite3VdbeMemShallowCopy(&c2, pMem2, MEM_Ephem);
  3653   3653       v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);
  3654   3654       n1 = v1==0 ? 0 : c1.n;
  3655   3655       v2 = sqlite3ValueText((sqlite3_value*)&c2, pColl->enc);
  3656   3656       n2 = v2==0 ? 0 : c2.n;
  3657   3657       rc = pColl->xCmp(pColl->pUser, n1, v1, n2, v2);
         3658  +    if( (v1==0 || v2==0) && prcErr ) *prcErr = SQLITE_NOMEM;
  3658   3659       sqlite3VdbeMemRelease(&c1);
  3659   3660       sqlite3VdbeMemRelease(&c2);
  3660         -    if( (v1==0 || v2==0) && prcErr ) *prcErr = SQLITE_NOMEM;
  3661   3661       return rc;
  3662   3662     }
  3663   3663   }
  3664   3664   
  3665   3665   /*
  3666   3666   ** Compare two blobs.  Return negative, zero, or positive if the first
  3667   3667   ** is less than, equal to, or greater than the second, respectively.

Changes to src/whereexpr.c.

   198    198     ExprList *pList;           /* List of operands to the LIKE operator */
   199    199     int c;                     /* One character in z[] */
   200    200     int cnt;                   /* Number of non-wildcard prefix characters */
   201    201     char wc[3];                /* Wildcard characters */
   202    202     sqlite3 *db = pParse->db;  /* Database connection */
   203    203     sqlite3_value *pVal = 0;
   204    204     int op;                    /* Opcode of pRight */
          205  +  int rc;                    /* Result code to return */
   205    206   
   206    207     if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){
   207    208       return 0;
   208    209     }
   209    210   #ifdef SQLITE_EBCDIC
   210    211     if( *pnoCase ) return 0;
   211    212   #endif
................................................................................
   263    264           }
   264    265         }
   265    266       }else{
   266    267         z = 0;
   267    268       }
   268    269     }
   269    270   
          271  +  rc = (z!=0);
   270    272     sqlite3ValueFree(pVal);
   271         -  return (z!=0);
          273  +  return rc;
   272    274   }
   273    275   #endif /* SQLITE_OMIT_LIKE_OPTIMIZATION */
   274    276   
   275    277   
   276    278   #ifndef SQLITE_OMIT_VIRTUALTABLE
   277    279   /*
   278    280   ** Check to see if the given expression is of the form