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

Unified Diff: third_party/sqlite/src/ext/fts2/fts2_icu.c

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/ext/fts2/fts2_hash.c ('k') | third_party/sqlite/src/ext/fts2/fts2_porter.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/ext/fts2/fts2_icu.c
diff --git a/third_party/sqlite/src/ext/fts2/fts2_icu.c b/third_party/sqlite/src/ext/fts2/fts2_icu.c
index a8b835962f91d3610ed82d37062c427693e03b84..6b6b1958ad7af55cb6fa0f8847b4e76ed7321cbb 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+1) * sizeof(int) + /* IcuCursor.aOffset[] */
- nChar * sizeof(UChar) /* IcuCursor.aChar[] */
+ ((nChar+3)&~3) * sizeof(UChar) + /* IcuCursor.aChar[] */
+ (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */
);
if( !pCsr ){
return SQLITE_NOMEM;
}
memset(pCsr, 0, sizeof(IcuCursor));
- pCsr->aOffset = (int *)&pCsr[1];
- pCsr->aChar = (UChar *)&pCsr->aOffset[nChar+1];
+ pCsr->aChar = (UChar *)&pCsr[1];
+ pCsr->aOffset = (int *)&pCsr->aChar[(nChar+3)&~3];
pCsr->aOffset[iOut] = iInput;
U8_NEXT(zInput, iInput, nInput, c);
« no previous file with comments | « third_party/sqlite/src/ext/fts2/fts2_hash.c ('k') | third_party/sqlite/src/ext/fts2/fts2_porter.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698