/ Check-in [9cbe3654]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Work around an over-zealous optimization in GCC 4.3.3. See CVSTrac ticket #4027.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9cbe3654055a78c09ea1ecd5dc599bcd888b57e3
User & Date: drh 2009-08-14 17:53:39
Context
2009-08-14
18:18
Update the amalgamation builder so that it avoids putting redundant SQLITE_API macros on declarations. check-in: 0d5b0587 user: drh tags: trunk
17:53
Work around an over-zealous optimization in GCC 4.3.3. See CVSTrac ticket #4027. check-in: 9cbe3654 user: drh tags: trunk
17:01
Fix a case where SQLite may write past the end of a buffer as a result of a corrupted database file. check-in: 43321a55 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbemem.c.

   414    414   
   415    415     /* Only mark the value as an integer if
   416    416     **
   417    417     **    (1) the round-trip conversion real->int->real is a no-op, and
   418    418     **    (2) The integer is neither the largest nor the smallest
   419    419     **        possible integer (ticket #3922)
   420    420     **
   421         -  ** The second term in the following conditional enforces the second
   422         -  ** condition under the assumption that addition overflow causes
   423         -  ** values to wrap around.
          421  +  ** The second and third terms in the following conditional enforces
          422  +  ** the second condition under the assumption that addition overflow causes
          423  +  ** values to wrap around.  On x86 hardware, the third term is always
          424  +  ** true and could be omitted.  But we leave it in because other
          425  +  ** architectures might behave differently.
   424    426     */
   425         -  if( pMem->r==(double)pMem->u.i && (pMem->u.i-1) < (pMem->u.i+1) ){
          427  +  if( pMem->r==(double)pMem->u.i && pMem->u.i>SMALLEST_INT64
          428  +      && ALWAYS(pMem->u.i<LARGEST_INT64) ){
   426    429       pMem->flags |= MEM_Int;
   427    430     }
   428    431   }
   429    432   
   430    433   /*
   431    434   ** Convert pMem to type integer.  Invalidate any prior representations.
   432    435   */