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

Prevent a warning about integer overflow when using a very large negative

LIMIT.

FossilOrigin-Name: 96106d5620eae51474234f4eec1d2c5bd570d486
This commit is contained in:
drh
2016-11-30 01:05:41 +00:00
parent d76a902c87
commit 64777ba834
3 changed files with 14 additions and 12 deletions

View File

@@ -6022,15 +6022,17 @@ case OP_IfNotZero: { /* jump, in1 */
/* Opcode: DecrJumpZero P1 P2 * * *
** Synopsis: if (--r[P1])==0 goto P2
**
** Register P1 must hold an integer. Decrement the value in register P1
** then jump to P2 if the new value is exactly zero.
** Register P1 must hold an integer. If the value in P1 is positive,
** decrement the value and jump to P2 if the new value is exactly zero.
*/
case OP_DecrJumpZero: { /* jump, in1 */
pIn1 = &aMem[pOp->p1];
assert( pIn1->flags&MEM_Int );
pIn1->u.i--;
VdbeBranchTaken(pIn1->u.i==0, 2);
if( pIn1->u.i==0 ) goto jump_to_p2;
if( pIn1->u.i>0 ){
pIn1->u.i--;
VdbeBranchTaken(pIn1->u.i==0, 2);
if( pIn1->u.i==0 ) goto jump_to_p2;
}
break;
}