diff options
author | dan <Dan Kennedy> | 2023-09-09 17:53:55 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2023-09-09 17:53:55 +0000 |
commit | ef2e43304eac85a6d7ed669f41c04c7cb344f18c (patch) | |
tree | 011283e49476decbc6bd71be589e6be42186e1d7 /src | |
parent | 1b2d170a8fb2fe1591af737d766edf9b58f3fd11 (diff) | |
download | sqlite-ef2e43304eac85a6d7ed669f41c04c7cb344f18c.tar.gz sqlite-ef2e43304eac85a6d7ed669f41c04c7cb344f18c.zip |
Remove out-of-date comment regarding use of Parse.pConstExpr.
FossilOrigin-Name: 71548f72ad578db3d6ee409956386ace23ab2258d37cdc29ef2fb126e48f1ee3
Diffstat (limited to 'src')
-rw-r--r-- | src/build.c | 11 | ||||
-rw-r--r-- | src/expr.c | 3 |
2 files changed, 5 insertions, 9 deletions
diff --git a/src/build.c b/src/build.c index fe3a781d6..59e3e23f0 100644 --- a/src/build.c +++ b/src/build.c @@ -246,19 +246,14 @@ void sqlite3FinishCoding(Parse *pParse){ */ if( pParse->pAinc ) sqlite3AutoincrementBegin(pParse); - /* Code constant expressions that where factored out of inner loops. - ** - ** The pConstExpr list might also contain expressions that we simply - ** want to keep around until the Parse object is deleted. Such - ** expressions have iConstExprReg==0. Do not generate code for - ** those expressions, of course. + /* Code constant expressions that were factored out of inner loops. */ if( pParse->pConstExpr ){ ExprList *pEL = pParse->pConstExpr; pParse->okConstFactor = 0; for(i=0; i<pEL->nExpr; i++){ - int iReg = pEL->a[i].u.iConstExprReg; - sqlite3ExprCode(pParse, pEL->a[i].pExpr, iReg); + assert( pEL->a[i].u.iConstExprReg>0 ); + sqlite3ExprCode(pParse, pEL->a[i].pExpr, pEL->a[i].u.iConstExprReg); } } diff --git a/src/expr.c b/src/expr.c index d96f36285..9f876e610 100644 --- a/src/expr.c +++ b/src/expr.c @@ -5048,7 +5048,7 @@ expr_code_doover: ** once. If no functions are involved, then factor the code out and put it at ** the end of the prepared statement in the initialization section. ** -** If regDest>=0 then the result is always stored in that register and the +** If regDest>0 then the result is always stored in that register and the ** result is not reusable. If regDest<0 then this routine is free to ** store the value wherever it wants. The register where the expression ** is stored is returned. When regDest<0, two identical expressions might @@ -5063,6 +5063,7 @@ int sqlite3ExprCodeRunJustOnce( ){ ExprList *p; assert( ConstFactorOk(pParse) ); + assert( regDest!=0 ); p = pParse->pConstExpr; if( regDest<0 && p ){ struct ExprList_item *pItem; |