/ Check-in [cfba2c8d]
Login

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

Overview
Comment:Fix an unsafe VM register deallocation.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cfba2c8dadbf1fa6f1602a327933570820a3b134
User & Date: drh 2013-02-16 02:41:01
Context
2013-02-19
11:51
Add the edit_cost_table= command to the spellfix1 virtual table, permitting the edit distance cost table to be changed at runtime. check-in: 89d63682 user: drh tags: trunk
2013-02-16
02:41
Fix an unsafe VM register deallocation. check-in: cfba2c8d user: drh tags: trunk
2013-02-15
04:21
Check for a NULL handle prior to manually calling winClose. check-in: 843e1c54 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

  2362   2362     ** operator is UNION, EXCEPT, or INTERSECT (but not UNION ALL).
  2363   2363     */
  2364   2364     if( op==TK_ALL ){
  2365   2365       regPrev = 0;
  2366   2366     }else{
  2367   2367       int nExpr = p->pEList->nExpr;
  2368   2368       assert( nOrderBy>=nExpr || db->mallocFailed );
  2369         -    regPrev = sqlite3GetTempRange(pParse, nExpr+1);
         2369  +    regPrev = pParse->nMem+1;
         2370  +    pParse->nMem += nExpr+1;
  2370   2371       sqlite3VdbeAddOp2(v, OP_Integer, 0, regPrev);
  2371   2372       pKeyDup = sqlite3DbMallocZero(db,
  2372   2373                     sizeof(*pKeyDup) + nExpr*(sizeof(CollSeq*)+1) );
  2373   2374       if( pKeyDup ){
  2374   2375         pKeyDup->aSortOrder = (u8*)&pKeyDup->aColl[nExpr];
  2375   2376         pKeyDup->nField = (u16)nExpr;
  2376   2377         pKeyDup->enc = ENC(db);
................................................................................
  2544   2545     sqlite3VdbeResolveLabel(v, labelCmpr);
  2545   2546     sqlite3VdbeAddOp4(v, OP_Permutation, 0, 0, 0, (char*)aPermute, P4_INTARRAY);
  2546   2547     sqlite3VdbeAddOp4(v, OP_Compare, destA.iSdst, destB.iSdst, nOrderBy,
  2547   2548                            (char*)pKeyMerge, P4_KEYINFO_HANDOFF);
  2548   2549     sqlite3VdbeChangeP5(v, OPFLAG_PERMUTE);
  2549   2550     sqlite3VdbeAddOp3(v, OP_Jump, addrAltB, addrAeqB, addrAgtB);
  2550   2551   
  2551         -  /* Release temporary registers
  2552         -  */
  2553         -  if( regPrev ){
  2554         -    sqlite3ReleaseTempRange(pParse, regPrev, nOrderBy+1);
  2555         -  }
  2556         -
  2557   2552     /* Jump to the this point in order to terminate the query.
  2558   2553     */
  2559   2554     sqlite3VdbeResolveLabel(v, labelEnd);
  2560   2555   
  2561   2556     /* Set the number of output columns
  2562   2557     */
  2563   2558     if( pDest->eDest==SRT_Output ){