Use (((i64)1)<<63) instead of just (1<<63) to compute the most negative 64-bit integer. (CVS 4131)

FossilOrigin-Name: be2570c061e1e751d1a46450bd1186549146526e
This commit is contained in:
danielk1977 2007-06-26 12:52:33 +00:00
parent 42d4ef2acc
commit 05fdd6c055
3 changed files with 9 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Fix\sfor\s#2444:\sAvoid\sSIGFPE\son\s64-bit\splatforms\swhen\sevaluating\sexpressions\slike\s((1<<63)/-1).\s(CVS\s4130)
D 2007-06-26T11:13:26
C Use\s(((i64)1)<<63)\sinstead\sof\sjust\s(1<<63)\sto\scompute\sthe\smost\snegative\s64-bit\sinteger.\s(CVS\s4131)
D 2007-06-26T12:52:34
F Makefile.in 7f7485a4cc039476a42e534b3f26ec90e2f9753e
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@ -138,7 +138,7 @@ F src/update.c 6b10becb6235ea314ed245fbfbf8b38755e3166e
F src/utf.c 01b2aba02b10d12903e9e1ff897215c9faf6b662
F src/util.c 9e81d417fc60bd2fe156f8f2317aa4845bc6cc90
F src/vacuum.c 8bd895d29e7074e78d4e80f948e35ddc9cf2beef
F src/vdbe.c b01ec63187c6ccc53f4d4520f58bb3e2b4c40409
F src/vdbe.c b776b68ad926974c72296145d1282ff6e956b4ff
F src/vdbe.h 001c5b257567c1d3de7feb2203aac71d0d7b16a3
F src/vdbeInt.h 7d2bf163d6d4e815724a457f2216dd8e38c3955c
F src/vdbeapi.c 7930b9a188ab385287ca3eb3840af7225cb43549
@ -516,7 +516,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P bbdcf372c6f2144a62fba742b3f4bd6b2fe58593
R 485893afc93c6a008cca6e703f7615a7
P c6dfd9e43449b0b3528281d9e2e4971c6ba86ab5
R ef164c42f461a60d1ea7875c9c81c3fc
U danielk1977
Z a1b4c3aea76673647cfd46dd712e2aca
Z 261217702720ef772fc27545ebd414f5

View File

@ -1 +1 @@
c6dfd9e43449b0b3528281d9e2e4971c6ba86ab5
be2570c061e1e751d1a46450bd1186549146526e

View File

@ -43,7 +43,7 @@
** in this file for details. If in doubt, do not deviate from existing
** commenting and indentation practices when changing or adding code.
**
** $Id: vdbe.c,v 1.633 2007/06/26 11:13:26 danielk1977 Exp $
** $Id: vdbe.c,v 1.634 2007/06/26 12:52:34 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@ -1160,7 +1160,7 @@ case OP_Remainder: { /* same as TK_REM, no-push */
** behaviour so that all architectures behave as if integer
** overflow occured.
*/
if( a==-1 && b==(1<<63) ) a = 1;
if( a==-1 && b==(((i64)1)<<63) ) a = 1;
b /= a;
break;
}