-C Add\sextra\sassert()\sstatements\strying\sto\scatch\sa\sMem\sobject\sin\san\sinconsistent\nstate.
-D 2014-03-01T14:45:18.939
+C Factor\sthe\sMem\sinvariant\schecker\sinto\sa\sseparate\sprocedure\s(rather\sthan\sa\nmacro)\sso\sthat\sit\scan\sbe\smore\seasily\sextended.
+D 2014-03-01T16:24:44.768
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/utf.c 6fc6c88d50448c469c5c196acf21617a24f90269
F src/util.c c46c90459ef9bdc0c6c73803cf4c55425b4771cf
F src/vacuum.c 3728d74919d4fb1356f9e9a13e27773db60b7179
-F src/vdbe.c e9eda47b8d8410d35840589daf8f3177efa04478
+F src/vdbe.c 9abaa1ebb8b98e33121ea1aade1022fdc195b464
F src/vdbe.h 147027d6e8e667a63e87177a38e2b42c71fdacf8
-F src/vdbeInt.h fa0cadb90633d260f0c7d21f68a2ec5b1c6900e2
+F src/vdbeInt.h a82d5ab4fd8138bdff7de4a267ea5c04e4cbb370
F src/vdbeapi.c 5bc41aaea448a7fc250902c418f1795859be3820
-F src/vdbeaux.c 087e7c75643157a903c9794294f4ff45cec28e7e
+F src/vdbeaux.c 2f97cd756e2704b06006b398ce468f0bcc006055
F src/vdbeblob.c d939997de046b8fcc607cfee4248f3d33dbcca50
-F src/vdbemem.c 7db453561091f0ed8fc7c96ee635cc612334025f
+F src/vdbemem.c 8c84ec056c7934cef359f4d49fa32b856eeffd88
F src/vdbesort.c 9d83601f9d6243fe70dd0169a2820c5ddfd48147
F src/vdbetrace.c 6f52bc0c51e144b7efdcfb2a8f771167a8816767
F src/vtab.c 21b932841e51ebd7d075e2d0ad1415dce8d2d5fd
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
-P e6ecf7337658624d664e1e71ba3fc527fd6578c1
-R ac78e315b388dc3aeb5c2c8983219f64
-T *branch * enhanced-mem-check
-T *sym-enhanced-mem-check *
-T -sym-trunk *
+P 4aeb3ae435c78070232fef21a147fde4e1c5cd31
+R c42d4082e634170a16f76850fb72106d
U drh
-Z 099f8256c2a0fcf00ebef2162229fe0b
+Z e1bae2e998058d57d79a76345aaf3403
-4aeb3ae435c78070232fef21a147fde4e1c5cd31
\ No newline at end of file
+354699d50e7d251504a7b3d6fbec9e5bcf99557f
\ No newline at end of file
assert( pOp->p1>0 );
assert( pOp->p1<=(p->nMem-p->nCursor) );
assert( memIsValid(&aMem[pOp->p1]) );
- assert( memSanity1(&aMem[pOp->p1]) );
+ assert( sqlite3VdbeCheckMemInvariants(&aMem[pOp->p1]) );
REGISTER_TRACE(pOp->p1, &aMem[pOp->p1]);
}
if( (pOp->opflags & OPFLG_IN2)!=0 ){
assert( pOp->p2>0 );
assert( pOp->p2<=(p->nMem-p->nCursor) );
assert( memIsValid(&aMem[pOp->p2]) );
- assert( memSanity1(&aMem[pOp->p2]) );
+ assert( sqlite3VdbeCheckMemInvariants(&aMem[pOp->p2]) );
REGISTER_TRACE(pOp->p2, &aMem[pOp->p2]);
}
if( (pOp->opflags & OPFLG_IN3)!=0 ){
assert( pOp->p3>0 );
assert( pOp->p3<=(p->nMem-p->nCursor) );
assert( memIsValid(&aMem[pOp->p3]) );
- assert( memSanity1(&aMem[pOp->p3]) );
+ assert( sqlite3VdbeCheckMemInvariants(&aMem[pOp->p3]) );
REGISTER_TRACE(pOp->p3, &aMem[pOp->p3]);
}
if( (pOp->opflags & OPFLG_OUT2)!=0 ){
*/
assert( p2<pC->nHdrParsed );
assert( rc==SQLITE_OK );
- assert( memSanity1(pDest) );
+ assert( sqlite3VdbeCheckMemInvariants(pDest) );
if( pC->szRow>=aOffset[p2+1] ){
/* This is the common case where the desired content fits on the original
** page - where the content is not on an overflow page */
#define memIsValid(M) ((M)->flags & MEM_Undefined)==0
#endif
-/*
-** A sanity check on a Mem object and especially the Mem.z field.
-** This check says that no more than one of the following may be true:
-** (1) Mem.z comes from Mem.zMalloc
-** (2) Mem.z has a destructor Mem.xDel
-** (3) Mem.z is an ephemeral string
-** (4) Mem.z is a static string
-**
-** Use only inside of an assert() as follows: assert( memSanify(pMem) );
-*/
-#ifdef SQLITE_DEBUG
-#define memSanity1(p) \
- ((((p)->zMalloc && (p)->zMalloc==(p)->z) ? 1 : 0) + \
- ((((p)->flags&MEM_Dyn)&&(p)->xDel) ? 1 : 0) + \
- (((p)->flags&MEM_Ephem) ? 1 : 0) + \
- (((p)->flags&MEM_Static) ? 1 : 0) <= 1 )
-#endif
-
/*
** Each auxilliary data pointer stored by a user defined function
** implementation calling sqlite3_set_auxdata() is stored in an instance
#ifdef SQLITE_DEBUG
void sqlite3VdbeMemAboutToChange(Vdbe*,Mem*);
+int sqlite3VdbeCheckMemInvariants(Mem*);
#endif
#ifndef SQLITE_OMIT_FOREIGN_KEY
}
for(pEnd=&p[N]; p<pEnd; p++){
assert( (&p[1])==pEnd || p[0].db==p[1].db );
- assert( memSanity1(p) );
+ assert( sqlite3VdbeCheckMemInvariants(p) );
/* This block is really an inlined version of sqlite3VdbeMemRelease()
** that takes advantage of the fact that the memory cell value is
#include "sqliteInt.h"
#include "vdbeInt.h"
+#ifdef SQLITE_DEBUG
+/*
+** Check invariants on a Mem object.
+**
+** This routine is intended for use inside of assert() statements, like
+** this: assert( sqlite3VdbeCheckMemInvariants(pMem) );
+*/
+int sqlite3VdbeCheckMemInvariants(Mem *p){
+ assert(
+ (((p)->zMalloc && (p)->zMalloc==(p)->z) ? 1 : 0) +
+ ((((p)->flags&MEM_Dyn)&&(p)->xDel) ? 1 : 0) +
+ (((p)->flags&MEM_Ephem) ? 1 : 0) +
+ (((p)->flags&MEM_Static) ? 1 : 0) <= 1 );
+ return 1;
+}
+#endif
+
+
/*
** If pMem is an object with a valid string representation, this routine
** ensures the internal encoding for the string representation is
** in pMem->z is discarded.
*/
int sqlite3VdbeMemGrow(Mem *pMem, int n, int bPreserve){
- assert( memSanity1(pMem) );
+ assert( sqlite3VdbeCheckMemInvariants(pMem) );
assert( (pMem->flags&MEM_RowSet)==0 );
/* If the bPreserve flag is set to true, then the memory cell must already
** (Mem.memType==MEM_Str).
*/
void sqlite3VdbeMemRelease(Mem *p){
- assert( memSanity1(p) );
+ assert( sqlite3VdbeCheckMemInvariants(p) );
VdbeMemRelease(p);
if( p->zMalloc ){
sqlite3DbFree(p->db, p->zMalloc);