aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <>2022-01-24 19:38:56 +0000
committerdrh <>2022-01-24 19:38:56 +0000
commit1da88b5ce634a7c53ba18d65072b5e44a415e800 (patch)
treeeade1016559fd9ee3bfd0580919460a3bf7b1fd9 /src/expr.c
parent0c7d3d399d4706db18789dbd50466e4d589e5fcd (diff)
downloadsqlite-1da88b5ce634a7c53ba18d65072b5e44a415e800.tar.gz
sqlite-1da88b5ce634a7c53ba18d65072b5e44a415e800.zip
Add ALWAYS() macros. Change some existing ALWAYS() into assert(). Other
code simplifications. FossilOrigin-Name: 4aa27b4fcd1ffd06c38357a87ba3f5776367570439c49652f0903873def0bb23
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/expr.c b/src/expr.c
index 07e81d299..373b4a634 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -209,7 +209,7 @@ CollSeq *sqlite3ExprCollSeq(Parse *pParse, const Expr *pExpr){
/* The Expr.x union is never used at the same time as Expr.pRight */
assert( ExprUseXList(p) );
assert( p->x.pList==0 || p->pRight==0 );
- if( p->x.pList!=0 && !db->mallocFailed ){
+ if( p->x.pList!=0 && ALWAYS(!db->mallocFailed) ){
int i;
for(i=0; ALWAYS(i<p->x.pList->nExpr); i++){
if( ExprHasProperty(p->x.pList->a[i].pExpr, EP_Collate) ){
@@ -3279,10 +3279,8 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
}
pSel->iLimit = 0;
if( sqlite3Select(pParse, pSel, &dest) ){
- if( pParse->nErr ){
- pExpr->op2 = pExpr->op;
- pExpr->op = TK_ERROR;
- }
+ pExpr->op2 = pExpr->op;
+ pExpr->op = TK_ERROR;
return 0;
}
pExpr->iTable = rReg = dest.iSDParm;
@@ -3499,10 +3497,10 @@ static void sqlite3ExprCodeIN(
}else{
destStep2 = destStep6 = sqlite3VdbeMakeLabel(pParse);
}
- if( pParse->nErr ) goto sqlite3ExprCodeIN_finished;
+// if( pParse->nErr ) goto sqlite3ExprCodeIN_finished;
for(i=0; i<nVector; i++){
Expr *p = sqlite3VectorFieldSubexpr(pExpr->pLeft, i);
- if( pParse->db->mallocFailed ) goto sqlite3ExprCodeIN_oom_error;
+ if( pParse->nErr ) goto sqlite3ExprCodeIN_oom_error;
if( sqlite3ExprCanBeNull(p) ){
sqlite3VdbeAddOp2(v, OP_IsNull, rLhs+i, destStep2);
VdbeCoverage(v);