diff options
author | drh <> | 2024-06-28 18:07:10 +0000 |
---|---|---|
committer | drh <> | 2024-06-28 18:07:10 +0000 |
commit | f13e2d22fe27b04d83b6f3f9232782e347bfb8e1 (patch) | |
tree | 5386fcda6e479e401862df33aed9eac02b226770 /src/expr.c | |
parent | 076bd5758b7a7e06cd2de9677ea9ba077d9dba2f (diff) | |
download | sqlite-f13e2d22fe27b04d83b6f3f9232782e347bfb8e1.tar.gz sqlite-f13e2d22fe27b04d83b6f3f9232782e347bfb8e1.zip |
Additional steps to make sure calls to sqlite3ExprToRegister() are sane.
FossilOrigin-Name: 1c42d7176b228791f99bc9971d92a9ab67b1e2956ca4f8d934bd1a3e596d6c80
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/expr.c b/src/expr.c index bda91df83..b7dbc721e 100644 --- a/src/expr.c +++ b/src/expr.c @@ -4270,10 +4270,14 @@ void sqlite3ExprCodeMove(Parse *pParse, int iFrom, int iTo, int nReg){ void sqlite3ExprToRegister(Expr *pExpr, int iReg){ Expr *p = sqlite3ExprSkipCollateAndLikely(pExpr); if( NEVER(p==0) ) return; - p->op2 = p->op; - p->op = TK_REGISTER; - p->iTable = iReg; - ExprClearProperty(p, EP_Skip); + if( p->op==TK_REGISTER ){ + assert( p->iTable==iReg ); + }else{ + p->op2 = p->op; + p->op = TK_REGISTER; + p->iTable = iReg; + ExprClearProperty(p, EP_Skip); + } } /* |