mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-02 05:54:29 +03:00
Further simplifications to the VDBE code generation logic that flow out
of the previous check-in. FossilOrigin-Name: 6a5dfe85b519b920ce8c842057767a8793d92236
This commit is contained in:
@@ -349,7 +349,7 @@ int sqlite3VdbeMakeLabel(Vdbe *v){
|
||||
if( p->aLabel ){
|
||||
p->aLabel[i] = -1;
|
||||
}
|
||||
return -1-i;
|
||||
return ADDR(i);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -359,7 +359,7 @@ int sqlite3VdbeMakeLabel(Vdbe *v){
|
||||
*/
|
||||
void sqlite3VdbeResolveLabel(Vdbe *v, int x){
|
||||
Parse *p = v->pParse;
|
||||
int j = -1-x;
|
||||
int j = ADDR(x);
|
||||
assert( v->magic==VDBE_MAGIC_INIT );
|
||||
assert( j<p->nLabel );
|
||||
assert( j>=0 );
|
||||
@@ -586,8 +586,8 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){
|
||||
|
||||
pOp->opflags = sqlite3OpcodeProperty[opcode];
|
||||
if( (pOp->opflags & OPFLG_JUMP)!=0 && pOp->p2<0 ){
|
||||
assert( -1-pOp->p2<pParse->nLabel );
|
||||
pOp->p2 = aLabel[-1-pOp->p2];
|
||||
assert( ADDR(pOp->p2)<pParse->nLabel );
|
||||
pOp->p2 = aLabel[ADDR(pOp->p2)];
|
||||
}
|
||||
}
|
||||
sqlite3DbFree(p->db, pParse->aLabel);
|
||||
@@ -644,15 +644,10 @@ int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp, int iLineno){
|
||||
addr = p->nOp;
|
||||
pOut = &p->aOp[addr];
|
||||
for(i=0; i<nOp; i++, aOp++, pOut++){
|
||||
int p2 = aOp->p2;
|
||||
pOut->opcode = aOp->opcode;
|
||||
pOut->p1 = aOp->p1;
|
||||
if( p2<0 ){
|
||||
assert( sqlite3OpcodeProperty[pOut->opcode] & OPFLG_JUMP );
|
||||
pOut->p2 = addr + ADDR(p2);
|
||||
}else{
|
||||
pOut->p2 = p2;
|
||||
}
|
||||
pOut->p2 = aOp->p2;
|
||||
assert( aOp->p2>=0 );
|
||||
pOut->p3 = aOp->p3;
|
||||
pOut->p4type = P4_NOTUSED;
|
||||
pOut->p4.p = 0;
|
||||
|
||||
Reference in New Issue
Block a user