mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Combine adjacent single-register OP_Copy instructions into a single
multi-register OP_Copy, where possible. Fix the Synopsis comment for multi-register OP_Copy instructions to show the correct register ranges. FossilOrigin-Name: 2ae22dc0cbed2feca4baf89d02aaace0331971d6
This commit is contained in:
12
src/expr.c
12
src/expr.c
@@ -3428,7 +3428,17 @@ int sqlite3ExprCodeExprList(
|
||||
}else{
|
||||
int inReg = sqlite3ExprCodeTarget(pParse, pExpr, target+i);
|
||||
if( inReg!=target+i ){
|
||||
sqlite3VdbeAddOp2(pParse->pVdbe, copyOp, inReg, target+i);
|
||||
VdbeOp *pOp;
|
||||
Vdbe *v = pParse->pVdbe;
|
||||
if( copyOp==OP_Copy
|
||||
&& (pOp=sqlite3VdbeGetOp(v, -1))->opcode==OP_Copy
|
||||
&& pOp->p1+pOp->p3+1==inReg
|
||||
&& pOp->p2+pOp->p3+1==target+i
|
||||
){
|
||||
pOp->p3++;
|
||||
}else{
|
||||
sqlite3VdbeAddOp2(v, copyOp, inReg, target+i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user