1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Add assert()s to show that jumps always land an an instruction that is between

1 and Vdbe.nOp-1.  Had these assert()s been in place before, they would have
caused an assertion fault for the byte-code error reported by
[forum:/forumpost/2482b32700|forum post 2482b32700].

FossilOrigin-Name: 8f8a58feb7047d19522ca32efbe42fd9ddf49aaf9064f7373eb56a88982406a2
This commit is contained in:
drh
2022-05-03 12:11:16 +00:00
parent 56f38db700
commit 207f626356
3 changed files with 9 additions and 7 deletions

View File

@@ -1043,6 +1043,8 @@ case OP_InitCoroutine: { /* jump */
/* Most jump operations do a goto to this spot in order to update
** the pOp pointer. */
jump_to_p2:
assert( pOp->p2>0 ); /* There are never any jumps to instruction 0 */
assert( pOp->p2<p->nOp ); /* Jumps must be in range */
pOp = &aOp[pOp->p2 - 1];
break;
}