From: drh Date: Fri, 22 Aug 2014 14:56:13 +0000 (+0000) Subject: Handle the 4-byte integer case in the stackless routine. X-Git-Tag: version-3.8.7~173^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8932becbef8458f91b9316249e2ac9a3d24ed816;p=thirdparty%2Fsqlite.git Handle the 4-byte integer case in the stackless routine. FossilOrigin-Name: 3f55484e81000c75e231f5580632a68e782ded4f --- diff --git a/manifest b/manifest index 66e4c0b1b6..2e7b46977a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Get\sthe\ssqlite3VdbeSerialGet()\sroutine\sto\srun\sfaster\sby\savoiding\sthe\suse\nof\slocal\svariables. -D 2014-08-22T14:34:05.936 +C Handle\sthe\s4-byte\sinteger\scase\sin\sthe\sstackless\sroutine. +D 2014-08-22T14:56:13.720 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 5eb79e334a5de69c87740edd56af6527dd219308 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -288,7 +288,7 @@ F src/vdbe.c f7f4066e4d6e3858878d76ce9288ea603e12ddf6 F src/vdbe.h c63fad052c9e7388d551e556e119c0bcf6bebdf8 F src/vdbeInt.h f5513f2b5ac1e2c5128996c7ea23add256a301df F src/vdbeapi.c 7858d7e7cd23267d3fbca18e3a28cce8e0d162a8 -F src/vdbeaux.c f83d5c265aea19d2e49ba018beaf99acff934020 +F src/vdbeaux.c d0b20a85d1ab8c951e5c8b2400a45252d6d2750c F src/vdbeblob.c 9205ce9d3b064d9600f8418a897fc88b5687d9ac F src/vdbemem.c d90a1e8acf8b63dc9d14cbbea12bfec6cec31394 F src/vdbesort.c f7f5563bf7d4695ca8f3203f3bf9de96d04ed0b3 @@ -1188,10 +1188,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 750bb0a0960606ab24037e0992e9f7a17524cc3e -R 6bc6a7681a89a137c23142249db6cf86 -T *branch * experimental -T *sym-experimental * -T -sym-trunk * +P 8267d82174099e548a4f78d06af0c6324c89b83d +R 3e2300d1a615c65baf7081c06688a5fd U drh -Z 612ca7a9b67c6d8d8dbe2b7affb6d3eb +Z 9f4fad73eafc2d2adf27281640f7d1a1 diff --git a/manifest.uuid b/manifest.uuid index 9538f73f10..301ab7c9f7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8267d82174099e548a4f78d06af0c6324c89b83d \ No newline at end of file +3f55484e81000c75e231f5580632a68e782ded4f \ No newline at end of file diff --git a/src/vdbeaux.c b/src/vdbeaux.c index d338806962..513481bf00 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -2961,6 +2961,7 @@ u32 sqlite3VdbeSerialPut(u8 *buf, Mem *pMem, u32 serial_type){ #define TWO_BYTE_INT(x) (256*(i8)((x)[0])|(x)[1]) #define THREE_BYTE_INT(x) (65536*(i8)((x)[0])|((x)[1]<<8)|(x)[2]) #define FOUR_BYTE_UINT(x) (((u32)(x)[0]<<24)|((x)[1]<<16)|((x)[2]<<8)|(x)[3]) +#define FOUR_BYTE_INT(x) (16777216*(i8)((x)[0])|((x)[1]<<16)|((x)[2]<<8)|(x)[3]) /* ** Deserialize the data blob pointed to by buf as serial type serial_type @@ -2976,15 +2977,9 @@ static u32 SQLITE_NOINLINE serialGet( u32 serial_type, /* Serial type to deserialize */ Mem *pMem /* Memory cell to write value into */ ){ - u64 x; - u32 y = FOUR_BYTE_UINT(buf); - if( serial_type==4 ){ - pMem->u.i = (i64)*(int*)&y; - pMem->flags = MEM_Int; - testcase( pMem->u.i<0 ); - return 4; - } - x = (((u64)y)<<32)|FOUR_BYTE_UINT(buf+4); + u64 x = FOUR_BYTE_UINT(buf); + u32 y = FOUR_BYTE_UINT(buf+4); + x = (x<<32) + y; if( serial_type==6 ){ pMem->u.i = *(i64*)&x; pMem->flags = MEM_Int; @@ -3039,18 +3034,22 @@ u32 sqlite3VdbeSerialGet( testcase( pMem->u.i<0 ); return 3; } + case 4: { /* 4-byte signed integer */ + pMem->u.i = FOUR_BYTE_INT(buf); + pMem->flags = MEM_Int; + testcase( pMem->u.i<0 ); + return 4; + } case 5: { /* 6-byte signed integer */ pMem->u.i = FOUR_BYTE_UINT(buf+2) + (((i64)1)<<32)*TWO_BYTE_INT(buf); pMem->flags = MEM_Int; testcase( pMem->u.i<0 ); return 6; } - case 4: /* 4-byte signed integer */ case 6: /* 8-byte signed integer */ case 7: { /* IEEE floating point */ - /* These three cases require local variables, so do them in a - ** separate routine to avoid having to move the frame pointer in - ** the common case */ + /* These use local variables, so do them in a separate routine + ** to avoid having to move the frame pointer in the common case */ return serialGet(buf,serial_type,pMem); } case 8: /* Integer 0 */