diff options
author | drh <drh@noemail.net> | 2009-08-14 17:53:39 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2009-08-14 17:53:39 +0000 |
commit | e74871ac06928c0c5d12a70a517d1b021c82c0e5 (patch) | |
tree | ab86d8289c63c9ba4df839cff8d43ae9bcbf08d7 /src | |
parent | 4361e79f14cb3e3276574a52bb15adbc27d70196 (diff) | |
download | sqlite-e74871ac06928c0c5d12a70a517d1b021c82c0e5.tar.gz sqlite-e74871ac06928c0c5d12a70a517d1b021c82c0e5.zip |
Work around an over-zealous optimization in GCC 4.3.3. See
CVSTrac ticket #4027.
FossilOrigin-Name: 9cbe3654055a78c09ea1ecd5dc599bcd888b57e3
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbemem.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/vdbemem.c b/src/vdbemem.c index e806db363..ef6ed8f9d 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -418,11 +418,14 @@ void sqlite3VdbeIntegerAffinity(Mem *pMem){ ** (2) The integer is neither the largest nor the smallest ** possible integer (ticket #3922) ** - ** The second term in the following conditional enforces the second - ** condition under the assumption that addition overflow causes - ** values to wrap around. + ** The second and third terms in the following conditional enforces + ** the second condition under the assumption that addition overflow causes + ** values to wrap around. On x86 hardware, the third term is always + ** true and could be omitted. But we leave it in because other + ** architectures might behave differently. */ - if( pMem->r==(double)pMem->u.i && (pMem->u.i-1) < (pMem->u.i+1) ){ + if( pMem->r==(double)pMem->u.i && pMem->u.i>SMALLEST_INT64 + && ALWAYS(pMem->u.i<LARGEST_INT64) ){ pMem->flags |= MEM_Int; } } |