summaryrefslogtreecommitdiffstats
path: root/third_party/sqlite
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/sqlite')
-rw-r--r--third_party/sqlite/README.chromium2
-rw-r--r--third_party/sqlite/amalgamation/sqlite3.c8
-rw-r--r--third_party/sqlite/misalignment.patch48
-rw-r--r--third_party/sqlite/src/ext/fts2/fts2_icu.c8
-rw-r--r--third_party/sqlite/src/ext/fts3/fts3_icu.c8
5 files changed, 62 insertions, 12 deletions
diff --git a/third_party/sqlite/README.chromium b/third_party/sqlite/README.chromium
index c910938..c502d47b 100644
--- a/third_party/sqlite/README.chromium
+++ b/third_party/sqlite/README.chromium
@@ -72,6 +72,7 @@ test.patch
mac_time_machine.patch
system-sqlite.patch
sqlite-3.7.6.3-fix-out-of-scope-memory-reference.patch
+misalignment.patch
So, e.g. you could do this to apply all our patches to vanilla SQLite:
@@ -87,6 +88,7 @@ patch -p0 < ../sqlite/test.patch
patch -p0 < ../sqlite/mac_time_machine.patch
patch -p0 < ../sqlite/system-sqlite.patch
patch -p0 < ../sqlite/sqlite-3.7.6.3-fix-out-of-scope-memory-reference.patch
+patch -p0 < ../sqlite/misalignment.patch
This will only be the case if all changes we make also update the corresponding
patch files. Therefore please remember to do that whenever you make a change!
diff --git a/third_party/sqlite/amalgamation/sqlite3.c b/third_party/sqlite/amalgamation/sqlite3.c
index 780d233..b9088a5 100644
--- a/third_party/sqlite/amalgamation/sqlite3.c
+++ b/third_party/sqlite/amalgamation/sqlite3.c
@@ -126117,15 +126117,15 @@ static int icuOpen(
nChar = nInput+1;
pCsr = (IcuCursor *)sqlite3_malloc(
sizeof(IcuCursor) + /* IcuCursor */
- nChar * sizeof(UChar) + /* IcuCursor.aChar[] */
- (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */
+ (nChar+1) * sizeof(int) + /* IcuCursor.aOffset[] */
+ nChar * sizeof(UChar) /* IcuCursor.aChar[] */
);
if( !pCsr ){
return SQLITE_NOMEM;
}
memset(pCsr, 0, sizeof(IcuCursor));
- pCsr->aChar = (UChar *)&pCsr[1];
- pCsr->aOffset = (int *)&pCsr->aChar[nChar];
+ pCsr->aOffset = (int *)&pCsr[1];
+ pCsr->aChar = (UChar *)&pCsr->aOffset[nChar+1];
pCsr->aOffset[iOut] = iInput;
U8_NEXT(zInput, iInput, nInput, c);
diff --git a/third_party/sqlite/misalignment.patch b/third_party/sqlite/misalignment.patch
new file mode 100644
index 0000000..e421208
--- /dev/null
+++ b/third_party/sqlite/misalignment.patch
@@ -0,0 +1,48 @@
+diff --git ext/fts2/fts2_icu.c ext/fts2/fts2_icu.c
+index 6b9687e..a8b8359 100644
+--- ext/fts2/fts2_icu.c
++++ ext/fts2/fts2_icu.c
+@@ -118,15 +118,15 @@ static int icuOpen(
+ nChar = nInput+1;
+ pCsr = (IcuCursor *)sqlite3_malloc(
+ sizeof(IcuCursor) + /* IcuCursor */
+- nChar * sizeof(UChar) + /* IcuCursor.aChar[] */
+- (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */
++ (nChar+1) * sizeof(int) + /* IcuCursor.aOffset[] */
++ nChar * sizeof(UChar) /* IcuCursor.aChar[] */
+ );
+ if( !pCsr ){
+ return SQLITE_NOMEM;
+ }
+ memset(pCsr, 0, sizeof(IcuCursor));
+- pCsr->aChar = (UChar *)&pCsr[1];
+- pCsr->aOffset = (int *)&pCsr->aChar[nChar];
++ pCsr->aOffset = (int *)&pCsr[1];
++ pCsr->aChar = (UChar *)&pCsr->aOffset[nChar+1];
+
+ pCsr->aOffset[iOut] = iInput;
+ U8_NEXT(zInput, iInput, nInput, c);
+diff --git ext/fts3/fts3_icu.c ext/fts3/fts3_icu.c
+index a75b14a..e406168 100644
+--- ext/fts3/fts3_icu.c
++++ ext/fts3/fts3_icu.c
+@@ -118,15 +118,15 @@ static int icuOpen(
+ nChar = nInput+1;
+ pCsr = (IcuCursor *)sqlite3_malloc(
+ sizeof(IcuCursor) + /* IcuCursor */
+- nChar * sizeof(UChar) + /* IcuCursor.aChar[] */
+- (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */
++ (nChar+1) * sizeof(int) + /* IcuCursor.aOffset[] */
++ nChar * sizeof(UChar) /* IcuCursor.aChar[] */
+ );
+ if( !pCsr ){
+ return SQLITE_NOMEM;
+ }
+ memset(pCsr, 0, sizeof(IcuCursor));
+- pCsr->aChar = (UChar *)&pCsr[1];
+- pCsr->aOffset = (int *)&pCsr->aChar[nChar];
++ pCsr->aOffset = (int *)&pCsr[1];
++ pCsr->aChar = (UChar *)&pCsr->aOffset[nChar+1];
+
+ pCsr->aOffset[iOut] = iInput;
+ U8_NEXT(zInput, iInput, nInput, c);
diff --git a/third_party/sqlite/src/ext/fts2/fts2_icu.c b/third_party/sqlite/src/ext/fts2/fts2_icu.c
index 6b9687e..a8b8359 100644
--- a/third_party/sqlite/src/ext/fts2/fts2_icu.c
+++ b/third_party/sqlite/src/ext/fts2/fts2_icu.c
@@ -118,15 +118,15 @@ static int icuOpen(
nChar = nInput+1;
pCsr = (IcuCursor *)sqlite3_malloc(
sizeof(IcuCursor) + /* IcuCursor */
- nChar * sizeof(UChar) + /* IcuCursor.aChar[] */
- (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */
+ (nChar+1) * sizeof(int) + /* IcuCursor.aOffset[] */
+ nChar * sizeof(UChar) /* IcuCursor.aChar[] */
);
if( !pCsr ){
return SQLITE_NOMEM;
}
memset(pCsr, 0, sizeof(IcuCursor));
- pCsr->aChar = (UChar *)&pCsr[1];
- pCsr->aOffset = (int *)&pCsr->aChar[nChar];
+ pCsr->aOffset = (int *)&pCsr[1];
+ pCsr->aChar = (UChar *)&pCsr->aOffset[nChar+1];
pCsr->aOffset[iOut] = iInput;
U8_NEXT(zInput, iInput, nInput, c);
diff --git a/third_party/sqlite/src/ext/fts3/fts3_icu.c b/third_party/sqlite/src/ext/fts3/fts3_icu.c
index a75b14a..e406168 100644
--- a/third_party/sqlite/src/ext/fts3/fts3_icu.c
+++ b/third_party/sqlite/src/ext/fts3/fts3_icu.c
@@ -118,15 +118,15 @@ static int icuOpen(
nChar = nInput+1;
pCsr = (IcuCursor *)sqlite3_malloc(
sizeof(IcuCursor) + /* IcuCursor */
- nChar * sizeof(UChar) + /* IcuCursor.aChar[] */
- (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */
+ (nChar+1) * sizeof(int) + /* IcuCursor.aOffset[] */
+ nChar * sizeof(UChar) /* IcuCursor.aChar[] */
);
if( !pCsr ){
return SQLITE_NOMEM;
}
memset(pCsr, 0, sizeof(IcuCursor));
- pCsr->aChar = (UChar *)&pCsr[1];
- pCsr->aOffset = (int *)&pCsr->aChar[nChar];
+ pCsr->aOffset = (int *)&pCsr[1];
+ pCsr->aChar = (UChar *)&pCsr->aOffset[nChar+1];
pCsr->aOffset[iOut] = iInput;
U8_NEXT(zInput, iInput, nInput, c);