Skip to content

Commit

Permalink
Upstream commit in trunk:
Browse files Browse the repository at this point in the history
http://www.sqlite.org/src/info/f9c4a7c8f4

Upstream commits in branch-3.7.6:
http://www.sqlite.org/src/info/a61786e760 (third hunk)
http://www.sqlite.org/src/info/e6a04bf9f1 (correction)

I have left out the comment addition seen in the trunk commit, because the backport to the 3.7.6 branch doesn't include it.

[Patch from Evangelos Foutras <evangelos@foutrelis.com> ]

BUG=122525
TEST=distros using gcc4.7 shouldn't crash.  see bug.
R=shess@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10387026
Patch from Evangelos Foutras <evangelos@foutrelis.com>.

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141687 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
shess@chromium.org committed Jun 12, 2012
1 parent 79a207b commit 46d044d
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 4 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,4 @@ Shouqun Liu <shouqun.liu@intel.com>
Jake Helfert <jake@helfert.us>
Hongbo Min <hongbo.min@intel.com>
Anastasios Cassiotis <tom.cassiotis@gmail.com>
Evangelos Foutras <evangelos@foutrelis.com>
2 changes: 2 additions & 0 deletions third_party/sqlite/README.chromium
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ webdb.patch
test.patch
mac_time_machine.patch
system-sqlite.patch
sqlite-3.7.6.3-fix-out-of-scope-memory-reference.patch

So, e.g. you could do this to apply all our patches to vanilla SQLite:

Expand All @@ -84,6 +85,7 @@ patch -p0 < ../sqlite/webdb.patch
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

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!
Expand Down
4 changes: 2 additions & 2 deletions third_party/sqlite/amalgamation/sqlite3.c
Original file line number Diff line number Diff line change
Expand Up @@ -119149,13 +119149,13 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderPending(
Fts3SegReader **ppReader /* OUT: SegReader for pending-terms */
){
Fts3SegReader *pReader = 0; /* Fts3SegReader object to return */
Fts3HashElem *pE; /* Iterator variable */
Fts3HashElem **aElem = 0; /* Array of term hash entries to scan */
int nElem = 0; /* Size of array at aElem */
int rc = SQLITE_OK; /* Return Code */

if( isPrefix ){
int nAlloc = 0; /* Size of allocated array at aElem */
Fts3HashElem *pE = 0; /* Iterator variable */

for(pE=fts3HashFirst(&p->pendingTerms); pE; pE=fts3HashNext(pE)){
char *zKey = (char *)fts3HashKey(pE);
Expand Down Expand Up @@ -119187,7 +119187,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderPending(
}

}else{
Fts3HashElem *pE = fts3HashFindElem(&p->pendingTerms, zTerm, nTerm);
pE = fts3HashFindElem(&p->pendingTerms, zTerm, nTerm);
if( pE ){
aElem = &pE;
nElem = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- ext/fts3/fts3_write.c.orig 2012-05-08 21:05:03.000000000 +0300
+++ ext/fts3/fts3_write.c 2012-05-08 21:07:08.000000000 +0300
@@ -1238,13 +1238,13 @@ int sqlite3Fts3SegReaderPending(
Fts3SegReader **ppReader /* OUT: SegReader for pending-terms */
){
Fts3SegReader *pReader = 0; /* Fts3SegReader object to return */
+ Fts3HashElem *pE; /* Iterator variable */
Fts3HashElem **aElem = 0; /* Array of term hash entries to scan */
int nElem = 0; /* Size of array at aElem */
int rc = SQLITE_OK; /* Return Code */

if( isPrefix ){
int nAlloc = 0; /* Size of allocated array at aElem */
- Fts3HashElem *pE = 0; /* Iterator variable */

for(pE=fts3HashFirst(&p->pendingTerms); pE; pE=fts3HashNext(pE)){
char *zKey = (char *)fts3HashKey(pE);
@@ -1276,7 +1276,7 @@ int sqlite3Fts3SegReaderPending(
}

}else{
- Fts3HashElem *pE = fts3HashFindElem(&p->pendingTerms, zTerm, nTerm);
+ pE = fts3HashFindElem(&p->pendingTerms, zTerm, nTerm);
if( pE ){
aElem = &pE;
nElem = 1;
4 changes: 2 additions & 2 deletions third_party/sqlite/src/ext/fts3/fts3_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,13 +1238,13 @@ int sqlite3Fts3SegReaderPending(
Fts3SegReader **ppReader /* OUT: SegReader for pending-terms */
){
Fts3SegReader *pReader = 0; /* Fts3SegReader object to return */
Fts3HashElem *pE; /* Iterator variable */
Fts3HashElem **aElem = 0; /* Array of term hash entries to scan */
int nElem = 0; /* Size of array at aElem */
int rc = SQLITE_OK; /* Return Code */

if( isPrefix ){
int nAlloc = 0; /* Size of allocated array at aElem */
Fts3HashElem *pE = 0; /* Iterator variable */

for(pE=fts3HashFirst(&p->pendingTerms); pE; pE=fts3HashNext(pE)){
char *zKey = (char *)fts3HashKey(pE);
Expand Down Expand Up @@ -1276,7 +1276,7 @@ int sqlite3Fts3SegReaderPending(
}

}else{
Fts3HashElem *pE = fts3HashFindElem(&p->pendingTerms, zTerm, nTerm);
pE = fts3HashFindElem(&p->pendingTerms, zTerm, nTerm);
if( pE ){
aElem = &pE;
nElem = 1;
Expand Down

0 comments on commit 46d044d

Please sign in to comment.