1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-05 04:30:38 +03:00

Omit OP_Close operations that occur immediately prior to OP_Halt and which

cannot be jumped over.

FossilOrigin-Name: 874b7e9999811c288ad41d07709f88e458d2d497
This commit is contained in:
drh
2014-01-04 16:49:02 +00:00
parent 54e2adb5f3
commit 61019c7883
7 changed files with 25 additions and 18 deletions

View File

@@ -276,6 +276,7 @@ void sqlite3VdbeResolveLabel(Vdbe *v, int x){
if( j>=0 && p->aLabel ){
p->aLabel[j] = v->nOp;
}
p->iFixedOp = v->nOp - 1;
}
/*
@@ -624,7 +625,8 @@ void sqlite3VdbeChangeP5(Vdbe *p, u8 val){
** the address of the next instruction to be coded.
*/
void sqlite3VdbeJumpHere(Vdbe *p, int addr){
if( ALWAYS(addr>=0) ) sqlite3VdbeChangeP2(p, addr, p->nOp);
sqlite3VdbeChangeP2(p, addr, p->nOp);
p->pParse->iFixedOp = p->nOp - 1;
}
@@ -729,8 +731,13 @@ void sqlite3VdbeChangeToNoop(Vdbe *p, int addr){
/*
** Remove the last opcode inserted
*/
void sqlite3VdbeDeleteLastOpcode(Vdbe *p){
p->nOp--;
int sqlite3VdbeDeletePriorOpcode(Vdbe *p, u8 op){
if( (p->nOp-1)>(p->pParse->iFixedOp) && p->aOp[p->nOp-1].opcode==op ){
sqlite3VdbeChangeToNoop(p, p->nOp-1);
return 1;
}else{
return 0;
}
}
/*