D. Richard Hipp writes:
> As always, please let us know if you encounter any difficulties with
> this or any other SQLite release.
It's still crashing due to undefined behaviour.
$ ./sqlite3 :memory: 'create table test(integer)'
Segmentation fault
Andreas.
--
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
--- sqlite-3.6.21/src/vdbeaux.c.orig 2009-12-01 17:08:35.000000000 +0100
+++ sqlite-3.6.21/src/vdbeaux.c 2009-12-08 02:27:22.000000000 +0100
@@ -1270,17 +1270,17 @@ void sqlite3VdbeIOTraceSql(Vdbe *p){
** request, then increment *pnByte by the amount of the request.
*/
static void allocSpace(
- char *pp, /* IN/OUT: Set *pp to point to allocated buffer */
+ void **pp, /* IN/OUT: Set *pp to point to allocated buffer */
int nByte, /* Number of bytes to allocate */
u8 **ppFrom, /* IN/OUT: Allocate from *ppFrom */
u8 *pEnd, /* Pointer to 1 byte past the end of *ppFrom buffer */
int *pnByte /* If allocation cannot be made, increment *pnByte */
){
assert( EIGHT_BYTE_ALIGNMENT(*ppFrom) );
- if( (*(void**)pp)==0 ){
+ if( (*pp)==0 ){
nByte = ROUND8(nByte);
if( &(*ppFrom)[nByte] <= pEnd ){
- *(void**)pp = (void *)*ppFrom;
+ *pp = (void *)*ppFrom;
*ppFrom += nByte;
}else{
*pnByte += nByte;
@@ -1357,14 +1357,25 @@ void sqlite3VdbeMakeReady(
assert( EIGHT_BYTE_ALIGNMENT(zCsr) );
do {
+ void *pp;
nByte = 0;
- allocSpace((char*)&p->aMem, nMem*sizeof(Mem), &zCsr, zEnd, &nByte);
- allocSpace((char*)&p->aVar, nVar*sizeof(Mem), &zCsr, zEnd, &nByte);
- allocSpace((char*)&p->apArg, nArg*sizeof(Mem*), &zCsr, zEnd, &nByte);
- allocSpace((char*)&p->azVar, nVar*sizeof(char*), &zCsr, zEnd, &nByte);
- allocSpace((char*)&p->apCsr,
+ pp = p->aMem;
+ allocSpace(&pp, nMem*sizeof(Mem), &zCsr, zEnd, &nByte);
+ p->aMem = pp;
+ pp = p->aVar;
+ allocSpace(&pp, nVar*sizeof(Mem), &zCsr, zEnd, &nByte);
+ p->aVar = pp;
+ pp = p->apArg;
+ allocSpace(&pp, nArg*sizeof(Mem*), &zCsr, zEnd, &nByte);
+ p->apArg = pp;
+ pp = p->azVar;
+ allocSpace(&pp, nVar*sizeof(char*), &zCsr, zEnd, &nByte);
+ p->azVar = pp;
+ pp = p->apCsr;
+ allocSpace(&pp,
nCursor*sizeof(VdbeCursor*), &zCsr, zEnd, &nByte
);
+ p->apCsr = pp;
if( nByte ){
p->pFree = sqlite3DbMallocZero(db, nByte);
}
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users