Merge changes for version 3.10.0.

FossilOrigin-Name: fa4705c91f9650ecd7ec967dbbf0028aabd8a98c
This commit is contained in:
drh
2016-01-06 15:14:53 +00:00
8 changed files with 46 additions and 45 deletions
+14 -6
View File
@@ -1849,19 +1849,27 @@ void sqlite3VdbeMakeReady(
*/
nMem += nCursor;
/* Allocate space for memory registers, SQL variables, VDBE cursors and
** an array to marshal SQL function arguments in.
/* zCsr will initially point to nFree bytes of unused space at the
** end of the opcode array, p->aOp. The computation of nFree is
** conservative - it might be smaller than the true number of free
** bytes, but never larger. nFree must be a multiple of 8 - it is
** rounded down if is not.
*/
zCsr = ((u8*)p->aOp) + ROUND8(sizeof(Op)*p->nOp); /* Available space */
nFree = pParse->szOpAlloc - ROUND8(sizeof(Op)*p->nOp); /* Size of zCsr */
n = ROUND8(sizeof(Op)*p->nOp); /* Bytes of opcode space used */
zCsr = &((u8*)p->aOp)[n]; /* Unused opcode space */
assert( EIGHT_BYTE_ALIGNMENT(zCsr) );
nFree = ROUNDDOWN8(pParse->szOpAlloc - n); /* Bytes of unused space */
assert( nFree>=0 );
if( nFree>0 ){
memset(zCsr, 0, nFree);
assert( EIGHT_BYTE_ALIGNMENT(&zCsr[nFree]) );
}
resolveP2Values(p, &nArg);
p->usesStmtJournal = (u8)(pParse->isMultiWrite && pParse->mayAbort);
if( pParse->explain && nMem<10 ){
nMem = 10;
}
memset(zCsr, 0, nFree);
assert( EIGHT_BYTE_ALIGNMENT(&zCsr[nFree]) );
p->expired = 0;
/* Memory for registers, parameters, cursor, etc, is allocated in two