From: dan Date: Wed, 3 Mar 2010 08:34:39 +0000 (+0000) Subject: Merge change [83e47ca006] into the 3.6.1 branch. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b54e09173f8260e7c4e4b0f2cf131f3acc55634c;p=thirdparty%2Fsqlite.git Merge change [83e47ca006] into the 3.6.1 branch. FossilOrigin-Name: 96bfaf9c8c26e24d72111ed970f85f25f5b1b62e --- diff --git a/manifest b/manifest index 292bcc0e93..89b4562042 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\ssome\stechnically\sunnecessary\svariable\sinitializations\sto\ssilence\scompiler\swarnings. -D 2010-02-25T07:44:09 +C Merge\schange\s[83e47ca006]\sinto\sthe\s3.6.1\sbranch. +D 2010-03-03T08:34:39 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 2713ea64947be3b35f35d9a3158bb8299c90b019 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -181,7 +181,7 @@ F src/tokenize.c bfdc945527a4645bf54c8bf34d1f18c019b37117 F src/trigger.c b61aaf7bff8e3763b234dbf46a1a64fb88a34e64 F src/update.c 1d7d70ac77b4e2fd9004f1279ed5dc645599ece9 F src/utf.c a7004436a6ef2aee012ace93de274dd0f3c7624e -F src/util.c 0828dd2ff38e66a5f641d58715f77518dfd01a95 +F src/util.c 4dc882cebdc80a7efec3c8083146d82d75e1f74c F src/vacuum.c ef342828002debc97514617af3424aea8ef8522c F src/vdbe.c 412c486b22f29cfdf922c6588c209f35127c3962 F src/vdbe.h 647fcf33a551ba10a974162c56846cb9aef2276b @@ -617,7 +617,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P d6343d035df36217e44549cfbcd9c1138658266c -R 056c8f25079b6a0c98d4704094fdc89c +P a25505978638bcb8fe11ab0bb4c17c3aec698d74 +R 5bbfeed6395ccacddd82b0cd2b6492e7 U dan -Z c7247ac8bdf6ccfe1c002c48b028ad66 +Z 416c0c52cc188554d4d16defdbe4775d diff --git a/manifest.uuid b/manifest.uuid index 388a2ab261..2932c472b1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a25505978638bcb8fe11ab0bb4c17c3aec698d74 \ No newline at end of file +96bfaf9c8c26e24d72111ed970f85f25f5b1b62e \ No newline at end of file diff --git a/src/util.c b/src/util.c index 794179d13a..4ec01eb8cc 100644 --- a/src/util.c +++ b/src/util.c @@ -545,6 +545,19 @@ int sqlite3PutVarint32(unsigned char *p, u32 v){ return sqlite3PutVarint(p, v); } +/* +** Bitmasks used by sqlite3GetVarint(). These precomputed constants +** are defined here rather than simply putting the constant expressions +** inline in order to work around bugs in the RVT compiler. +** +** SLOT_2_0 A mask for (0x7f<<14) | 0x7f +** +** SLOT_4_2_0 A mask for (0x7f<<28) | SLOT_2_0 +*/ +#define SLOT_2_0 0x001fc07f +#define SLOT_4_2_0 0xf01fc07f + + /* ** Read a 64-bit variable-length integer from memory starting at p[0]. ** Return the number of bytes read. The value is stored in *v. @@ -572,13 +585,17 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){ return 2; } + /* Verify that constants are precomputed correctly */ + assert( SLOT_2_0 == ((0x7f<<14) | (0x7f)) ); + assert( SLOT_4_2_0 == ((0xf<<28) | (0x7f<<14) | (0x7f)) ); + p++; a = a<<14; a |= *p; /* a: p0<<14 | p2 (unmasked) */ if (!(a&0x80)) { - a &= (0x7f<<14)|(0x7f); + a &= SLOT_2_0; b &= 0x7f; b = b<<7; a |= b; @@ -587,14 +604,14 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){ } /* CSE1 from below */ - a &= (0x7f<<14)|(0x7f); + a &= SLOT_2_0; p++; b = b<<14; b |= *p; /* b: p1<<14 | p3 (unmasked) */ if (!(b&0x80)) { - b &= (0x7f<<14)|(0x7f); + b &= SLOT_2_0; /* moved CSE1 up */ /* a &= (0x7f<<14)|(0x7f); */ a = a<<7; @@ -608,7 +625,7 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){ /* 1:save off p0<<21 | p1<<14 | p2<<7 | p3 (masked) */ /* moved CSE1 up */ /* a &= (0x7f<<14)|(0x7f); */ - b &= (0x7f<<14)|(0x7f); + b &= SLOT_2_0; s = a; /* s: p0<<14 | p2 (masked) */ @@ -641,7 +658,7 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){ { /* we can skip this cause it was (effectively) done above in calc'ing s */ /* b &= (0x7f<<28)|(0x7f<<14)|(0x7f); */ - a &= (0x7f<<14)|(0x7f); + a &= SLOT_2_0; a = a<<7; a |= b; s = s>>18; @@ -655,8 +672,8 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){ /* a: p2<<28 | p4<<14 | p6 (unmasked) */ if (!(a&0x80)) { - a &= (0x0f<<28)|(0x7f<<14)|(0x7f); - b &= (0x7f<<14)|(0x7f); + a &= SLOT_4_2_0; + b &= SLOT_2_0; b = b<<7; a |= b; s = s>>11; @@ -665,14 +682,14 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){ } /* CSE2 from below */ - a &= (0x7f<<14)|(0x7f); + a &= SLOT_2_0; p++; b = b<<14; b |= *p; /* b: p3<<28 | p5<<14 | p7 (unmasked) */ if (!(b&0x80)) { - b &= (0x0f<<28)|(0x7f<<14)|(0x7f); + b &= SLOT_4_2_0; /* moved CSE2 up */ /* a &= (0x7f<<14)|(0x7f); */ a = a<<7; @@ -689,7 +706,7 @@ int sqlite3GetVarint(const unsigned char *p, u64 *v){ /* moved CSE2 up */ /* a &= (0x7f<<29)|(0x7f<<15)|(0xff); */ - b &= (0x7f<<14)|(0x7f); + b &= SLOT_2_0; b = b<<8; a |= b;