From 569c6676a6ddb0ff73821d7693b5e18ddef809b9 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 16 Oct 2014 22:51:35 -0400 Subject: Imported Upstream version 3.2.0 --- src/test_stat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/test_stat.c') diff --git a/src/test_stat.c b/src/test_stat.c index d4c902b..615df3d 100644 --- a/src/test_stat.c +++ b/src/test_stat.c @@ -397,6 +397,7 @@ static int statNext(sqlite3_vtab_cursor *pCursor){ sqlite3_free(pCsr->zPath); pCsr->zPath = 0; +statNextRestart: if( pCsr->aPage[0].pPg==0 ){ rc = sqlite3_step(pCsr->pStmt); if( rc==SQLITE_ROW ){ @@ -448,11 +449,11 @@ static int statNext(sqlite3_vtab_cursor *pCursor){ p->iCell++; } - while( !p->iRightChildPg || p->iCell>p->nCell ){ + if( !p->iRightChildPg || p->iCell>p->nCell ){ statClearPage(p); if( pCsr->iPage==0 ) return statNext(pCursor); pCsr->iPage--; - p = &pCsr->aPage[pCsr->iPage]; + goto statNextRestart; /* Tail recursion */ } pCsr->iPage++; assert( p==&pCsr->aPage[pCsr->iPage-1] ); -- cgit v1.2.3