aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2015-12-09 17:23:12 +0000
committerdrh <drh@noemail.net>2015-12-09 17:23:12 +0000
commit5ef09bf918bb26fbb900ec14850114b47f83cbfe (patch)
tree48b9c0c9ad905c32f1e564de7ea51dd3d0d8d5c4 /src
parent8c8dddc90411eef6d23bf6b40bcb05eb65d240bf (diff)
downloadsqlite-5ef09bf918bb26fbb900ec14850114b47f83cbfe.tar.gz
sqlite-5ef09bf918bb26fbb900ec14850114b47f83cbfe.zip
Further simplifications to the VDBE code generation logic that flow out
of the previous check-in. FossilOrigin-Name: 6a5dfe85b519b920ce8c842057767a8793d92236
Diffstat (limited to 'src')
-rw-r--r--src/vdbeaux.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index 26d162e93..38cd492af 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -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;