SQLite

Check-in [bea05ddddf]
Login

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

Overview
Comment:Fix a boundary case for the integer affinity routine for non-x86 processors.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bea05ddddf5089bac9b1aa9fe1d2cd24b069ad44
User & Date: drh 2012-02-10 01:25:13.282
Context
2012-02-10
03:10
Fix an important bug in the handling of EINTR in unixRead(). Never came up on x86 but crashes on sparc. (check-in: 1a16db0bca user: drh tags: trunk)
01:25
Fix a boundary case for the integer affinity routine for non-x86 processors. (check-in: bea05ddddf user: drh tags: trunk)
2012-02-08
12:13
Add an autoconf test for malloc.h and use the results of that test to conditionally #include the malloc.h header file. (check-in: 16a471129d user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbemem.c.
411
412
413
414
415
416
417
418


419




420
421
422
423
424
425
426
  **
  ** 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.
*/







|
>
>
|
>
>
>
>







411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
  **
  ** 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
#if defined(__i486__) || defined(__x86_64__)
   && ALWAYS(pMem->u.i<LARGEST_INT64)
#else
   && pMem->u.i<LARGEST_INT64
#endif
  ){
    pMem->flags |= MEM_Int;
  }
}

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