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

Side by Side 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, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 From b641825da7cffe1bcbf54cdc4e619b70615cb9c8 Mon Sep 17 00:00:00 2001
2 From: Scott Hess <shess@chromium.org>
3 Date: Fri, 19 Dec 2014 11:36:41 -0800
4 Subject: [PATCH 20/24] [fts2][backport] Fix misaligned address in icu
5 tokenizer.
6
7 Kept separate from fts3 version in hopes that we can stop linking fts2.
8 ---
9 third_party/sqlite/src/ext/fts2/fts2_icu.c | 8 ++++----
10 1 file changed, 4 insertions(+), 4 deletions(-)
11
12 diff --git a/third_party/sqlite/src/ext/fts2/fts2_icu.c b/third_party/sqlite/src /ext/fts2/fts2_icu.c
13 index 6b9687e..a8b8359 100644
14 --- a/third_party/sqlite/src/ext/fts2/fts2_icu.c
15 +++ b/third_party/sqlite/src/ext/fts2/fts2_icu.c
16 @@ -118,15 +118,15 @@ static int icuOpen(
17 nChar = nInput+1;
18 pCsr = (IcuCursor *)sqlite3_malloc(
19 sizeof(IcuCursor) + /* IcuCursor */
20 - nChar * sizeof(UChar) + /* IcuCursor.aChar[] */
21 - (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */
22 + (nChar+1) * sizeof(int) + /* IcuCursor.aOffset[] */
23 + nChar * sizeof(UChar) /* IcuCursor.aChar[] */
24 );
25 if( !pCsr ){
26 return SQLITE_NOMEM;
27 }
28 memset(pCsr, 0, sizeof(IcuCursor));
29 - pCsr->aChar = (UChar *)&pCsr[1];
30 - pCsr->aOffset = (int *)&pCsr->aChar[nChar];
31 + pCsr->aOffset = (int *)&pCsr[1];
32 + pCsr->aChar = (UChar *)&pCsr->aOffset[nChar+1];
33
34 pCsr->aOffset[iOut] = iInput;
35 U8_NEXT(zInput, iInput, nInput, c);
36 --
37 2.2.1
38
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698