diff options
author | drh <drh@noemail.net> | 2019-02-12 22:58:32 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-02-12 22:58:32 +0000 |
commit | 82642f815bc9f31af3403fbbdf94d6f8d9ab3615 (patch) | |
tree | bee847097bea09cbe2b1540d0abad99b81aff4dd /src | |
parent | c332e04310c111eeb3354900e3001b6760279980 (diff) | |
download | sqlite-82642f815bc9f31af3403fbbdf94d6f8d9ab3615.tar.gz sqlite-82642f815bc9f31af3403fbbdf94d6f8d9ab3615.zip |
Ensure that the nProgressLimit variable is always initialized in
sqlite3VdbeExec(), even if the routine jumps to its exit processing early.
FossilOrigin-Name: 167b91df77fff1a84791f6ab5f72239b90475475be690a838248119b6dd312f0
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index 7ade29cb7..880d16adf 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -622,6 +622,15 @@ int sqlite3VdbeExec( assert( p->magic==VDBE_MAGIC_RUN ); /* sqlite3_step() verifies this */ sqlite3VdbeEnter(p); +#ifndef SQLITE_OMIT_PROGRESS_CALLBACK + if( db->xProgress ){ + u32 iPrior = p->aCounter[SQLITE_STMTSTATUS_VM_STEP]; + assert( 0 < db->nProgressOps ); + nProgressLimit = db->nProgressOps - (iPrior % db->nProgressOps); + }else{ + nProgressLimit = 0xffffffff; + } +#endif if( p->rc==SQLITE_NOMEM ){ /* This happens if a malloc() inside a call to sqlite3_column_text() or ** sqlite3_column_text16() failed. */ @@ -635,15 +644,6 @@ int sqlite3VdbeExec( db->busyHandler.nBusy = 0; if( db->u1.isInterrupted ) goto abort_due_to_interrupt; sqlite3VdbeIOTraceSql(p); -#ifndef SQLITE_OMIT_PROGRESS_CALLBACK - if( db->xProgress ){ - u32 iPrior = p->aCounter[SQLITE_STMTSTATUS_VM_STEP]; - assert( 0 < db->nProgressOps ); - nProgressLimit = db->nProgressOps - (iPrior % db->nProgressOps); - }else{ - nProgressLimit = 0xffffffff; - } -#endif #ifdef SQLITE_DEBUG sqlite3BeginBenignMalloc(); if( p->pc==0 |