aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormlcreech <mlcreech@noemail.net>2008-03-14 13:02:08 +0000
committermlcreech <mlcreech@noemail.net>2008-03-14 13:02:08 +0000
commitdda5b68cb3d4beb5a6379f1ba6d4622c4a90f2bc (patch)
tree31559537d7eca2feedfde014e4bfb1943684971e
parentd5fe8d6c4314f2739d2460d15845fac6fcec555c (diff)
downloadsqlite-dda5b68cb3d4beb5a6379f1ba6d4622c4a90f2bc.tar.gz
sqlite-dda5b68cb3d4beb5a6379f1ba6d4622c4a90f2bc.zip
Revise Bitvec struct sizing to prevent assertion failure on 64-bit systems (CVS 4862)
FossilOrigin-Name: a3c12dbe95c8fb93f5b9006bf5d2c5b933fc5e87
-rw-r--r--manifest16
-rw-r--r--manifest.uuid2
-rw-r--r--src/bitvec.c11
-rw-r--r--src/sqliteInt.h32
4 files changed, 42 insertions, 19 deletions
diff --git a/manifest b/manifest
index 8f8b9c6f9..dafee803e 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\ssecond\srace\scondition\sin\slock4.test.\s(CVS\s4861)
-D 2008-03-14T08:57:42
+C Revise\sBitvec\sstruct\ssizing\sto\sprevent\sassertion\sfailure\son\s64-bit\ssystems\s(CVS\s4862)
+D 2008-03-14T13:02:08
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
F Makefile.in 5be94fea84f1599672e5041de03b97990baca593
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -82,7 +82,7 @@ F src/alter.c b494a50f239a760565ce6220ee316e96956ec054
F src/analyze.c a78ac494668581fe7f54ee63700815bb0ea34261
F src/attach.c e13d62597e8725075b27186817f7e745122af24e
F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
-F src/bitvec.c bc5b52a590dc38a48fdded1f098b84af673448c9
+F src/bitvec.c fac68429a9916a50229c4ab88abb69c00c438f7f
F src/btmutex.c 483ced3c52205b04b97df69161fadbf87f4f1ea2
F src/btree.c 439e2684892d2b70996dc3c5fba25e07949e1d84
F src/btree.h 19dcf5ad23c17b98855da548e9a8e3eb4429d5eb
@@ -141,7 +141,7 @@ F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
F src/shell.c 22297fffa6f00a6c6d44020fa13b1184a1bb372d
F src/sqlite.h.in 1cf531c45f20cedf0786f4dc5dedc8dcc33b5df3
F src/sqlite3ext.h 50c70a894ffe8e6ada5948c89b91db0a80a6b2a7
-F src/sqliteInt.h 341120a615fc0042251de78e782a03f67d29f729
+F src/sqliteInt.h 2726f01ca494e518542732ee57a490806f92bace
F src/sqliteLimit.h ee4430f88f69bf63527967bb35ca52af7b0ccb1e
F src/table.c 2c48c575dd59b3a6c5c306bc55f51a9402cf429a
F src/tclsqlite.c d95e0e74c7167b2807f9f4f73bf45f7c58096297
@@ -623,7 +623,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 8a726e3731cd19cc52c6dab16d032d7237b7450b
-R 4dcfb55457de268e049e3f884cf30fb9
-U danielk1977
-Z 77e13abccbb84eb815a0bdf10106a670
+P e62858b9b8a12ecbad8037868d03469d27418377
+R a1f1b21a46d1ac4b2908c100a2665b2b
+U mlcreech
+Z 08450c1f5e8015ace2e676b30b546a90
diff --git a/manifest.uuid b/manifest.uuid
index b6d32303e..78d0c91e3 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-e62858b9b8a12ecbad8037868d03469d27418377 \ No newline at end of file
+a3c12dbe95c8fb93f5b9006bf5d2c5b933fc5e87 \ No newline at end of file
diff --git a/src/bitvec.c b/src/bitvec.c
index 23a002c64..7fa8a8aec 100644
--- a/src/bitvec.c
+++ b/src/bitvec.c
@@ -32,16 +32,19 @@
** start of a transaction, and is thus usually less than a few thousand,
** but can be as large as 2 billion for a really big database.
**
-** @(#) $Id: bitvec.c,v 1.1 2008/02/18 14:47:34 drh Exp $
+** @(#) $Id: bitvec.c,v 1.2 2008/03/14 13:02:08 mlcreech Exp $
*/
#include "sqliteInt.h"
#define BITVEC_SZ 512
-#define BITVEC_NCHAR (BITVEC_SZ-12)
+/* Round the union size down to the nearest pointer boundary, since that's how
+** it will be aligned within the Bitvec struct. */
+#define BITVEC_USIZE (((BITVEC_SZ-12)/sizeof(Bitvec *))*sizeof(Bitvec *))
+#define BITVEC_NCHAR BITVEC_USIZE
#define BITVEC_NBIT (BITVEC_NCHAR*8)
-#define BITVEC_NINT ((BITVEC_SZ-12)/4)
+#define BITVEC_NINT (BITVEC_USIZE/4)
#define BITVEC_MXHASH (BITVEC_NINT/2)
-#define BITVEC_NPTR ((BITVEC_SZ-12)/8)
+#define BITVEC_NPTR (BITVEC_USIZE/sizeof(Bitvec *))
#define BITVEC_HASH(X) (((X)*37)%BITVEC_NINT)
diff --git a/src/sqliteInt.h b/src/sqliteInt.h
index 6e2651863..bf87c74df 100644
--- a/src/sqliteInt.h
+++ b/src/sqliteInt.h
@@ -11,7 +11,7 @@
*************************************************************************
** Internal interface definitions for SQLite.
**
-** @(#) $Id: sqliteInt.h,v 1.672 2008/03/10 16:17:59 drh Exp $
+** @(#) $Id: sqliteInt.h,v 1.673 2008/03/14 13:02:08 mlcreech Exp $
*/
#ifndef _SQLITEINT_H_
#define _SQLITEINT_H_
@@ -314,19 +314,39 @@
** cc '-DUINTPTR_TYPE=long long int' ...
*/
#ifndef UINT32_TYPE
-# define UINT32_TYPE unsigned int
+# ifdef HAVE_UINT32_T
+# define UINT32_TYPE uint32_t
+# else
+# define UINT32_TYPE unsigned int
+# endif
#endif
#ifndef UINT16_TYPE
-# define UINT16_TYPE unsigned short int
+# ifdef HAVE_UINT16_T
+# define UINT16_TYPE uint16_t
+# else
+# define UINT16_TYPE unsigned short int
+# endif
#endif
#ifndef INT16_TYPE
-# define INT16_TYPE short int
+# ifdef HAVE_INT16_T
+# define INT16_TYPE int16_t
+# else
+# define INT16_TYPE short int
+# endif
#endif
#ifndef UINT8_TYPE
-# define UINT8_TYPE unsigned char
+# ifdef HAVE_UINT8_T
+# define UINT8_TYPE uint8_t
+# else
+# define UINT8_TYPE unsigned char
+# endif
#endif
#ifndef INT8_TYPE
-# define INT8_TYPE signed char
+# ifdef HAVE_INT8_T
+# define INT8_TYPE int8_t
+# else
+# define INT8_TYPE signed char
+# endif
#endif
#ifndef LONGDOUBLE_TYPE
# define LONGDOUBLE_TYPE long double