Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: third_party/sqlite/patches/0020-fts2-backport-Fix-misaligned-address-in-icu-tokenize.patch

Issue 885473002: [sql] Rewrite sqlite patching "system". (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/sqlite/patches/0020-fts2-backport-Fix-misaligned-address-in-icu-tokenize.patch
diff --git a/third_party/sqlite/patches/0020-fts2-backport-Fix-misaligned-address-in-icu-tokenize.patch b/third_party/sqlite/patches/0020-fts2-backport-Fix-misaligned-address-in-icu-tokenize.patch
new file mode 100644
index 0000000000000000000000000000000000000000..c0cb28758fbc95d15fff810c29f4bef569cde839
--- /dev/null
+++ b/third_party/sqlite/patches/0020-fts2-backport-Fix-misaligned-address-in-icu-tokenize.patch
@@ -0,0 +1,38 @@
+From b641825da7cffe1bcbf54cdc4e619b70615cb9c8 Mon Sep 17 00:00:00 2001
+From: Scott Hess <shess@chromium.org>
+Date: Fri, 19 Dec 2014 11:36:41 -0800
+Subject: [PATCH 20/24] [fts2][backport] Fix misaligned address in icu
+ tokenizer.
+
+Kept separate from fts3 version in hopes that we can stop linking fts2.
+---
+ third_party/sqlite/src/ext/fts2/fts2_icu.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+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);
+--
+2.2.1
+

Powered by Google App Engine
This is Rietveld 408576698