Bug 720461 - Fix loop logic in Android SQLiteBridge. r=dougt
authorGian-Carlo Pascutto <gpascutto@mozilla.com>
Wed, 25 Jan 2012 07:53:04 +0100
changeset 85321 08917f31c6abcf06e3756e9865a21c6ec1ae58f5
parent 85320 1a9bebba9dc26fdaa4c7d5c82aaf7947c6fcee8b
child 85322 badb5fd300312eb2c07f5538cc078f1d473f810b
push id21915
push userbmo@edmorley.co.uk
push dateWed, 25 Jan 2012 14:16:23 +0000
treeherdermozilla-central@0d5ad6a6f814 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt
bugs720461
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 720461 - Fix loop logic in Android SQLiteBridge. r=dougt
mozglue/android/SQLiteBridge.cpp
--- a/mozglue/android/SQLiteBridge.cpp
+++ b/mozglue/android/SQLiteBridge.cpp
@@ -230,17 +230,17 @@ Java_org_mozilla_gecko_sqlite_SQLiteBrid
         jstring jStr = jenv->NewStringUTF(colName);
         jenv->CallBooleanMethod(jColumns, jArrayListAdd, jStr);
         jenv->DeleteLocalRef(jStr);
     }
 
     // For each row, add an Object[] to the passed ArrayList,
     // with that containing either String or ByteArray objects
     // containing the columns
-    do {
+    while (rc != SQLITE_DONE) {
         // Process row
         // Construct Object[]
         jobjectArray jRow = jenv->NewObjectArray(cols,
                                                  objectClass,
                                                  NULL);
         if (jRow == NULL) {
             LOG("Can't allocate jRow Object[]\n");
             goto error_close;
@@ -292,17 +292,17 @@ Java_org_mozilla_gecko_sqlite_SQLiteBrid
 
         // Get next row
         rc = f_sqlite3_step(ppStmt);
         // Real error?
         if (rc != SQLITE_ROW && rc != SQLITE_DONE) {
             LOG("Can't re-step statement:(%d) %s\n", rc, f_sqlite3_errmsg(db));
             goto error_close;
         }
-    } while (rc != SQLITE_DONE);
+    }
 
     rc = f_sqlite3_finalize(ppStmt);
     if (rc != SQLITE_OK) {
         LOG("Can't finalize statement: %s\n", f_sqlite3_errmsg(db));
         goto error_close;
     }
 
     f_sqlite3_close(db);