/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to src/vdbemem.c.

414
415
416
417
418
419
420
421
422
423


424
425

426
427
428
429
430
431
432

  /* Only mark the value as an integer if
  **
  **    (1) the round-trip conversion real->int->real is a no-op, and
  **    (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.


  */
  if( pMem->r==(double)pMem->u.i && (pMem->u.i-1) < (pMem->u.i+1) ){

    pMem->flags |= MEM_Int;
  }
}

/*
** Convert pMem to type integer.  Invalidate any prior representations.
*/







|
|
|
>
>

|
>







414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435

  /* Only mark the value as an integer if
  **
  **    (1) the round-trip conversion real->int->real is a no-op, and
  **    (2) The integer is neither the largest nor the smallest
  **        possible integer (ticket #3922)
  **
  ** 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>SMALLEST_INT64
      && ALWAYS(pMem->u.i<LARGEST_INT64) ){
    pMem->flags |= MEM_Int;
  }
}

/*
** Convert pMem to type integer.  Invalidate any prior representations.
*/