]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Prevent a warning about integer overflow when using a very large negative
authordrh <drh@noemail.net>
Wed, 30 Nov 2016 01:05:41 +0000 (01:05 +0000)
committerdrh <drh@noemail.net>
Wed, 30 Nov 2016 01:05:41 +0000 (01:05 +0000)
LIMIT.

FossilOrigin-Name: 96106d5620eae51474234f4eec1d2c5bd570d486

manifest
manifest.uuid
src/vdbe.c

index aecf668d2a8a1a1205bb59a37b964035f5e6b0a1..ce5272dd3412c1f97644e2c77b5a4d2bd8e75c49 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Further\schanges\sto\sthe\sdate/time\sfunctions\sto\ssuppress\sharmless\ssigned\ninteger\soverflow\swarnings\sthat\scould\shave\soccurred\swhen\sdoing\sout-of-range\ndate\scalculations\swhich,\saccording\sto\sthe\sdocs,\sgive\sundefined\sresults.
-D 2016-11-30T00:48:28.495
+C Prevent\sa\swarning\sabout\sinteger\soverflow\swhen\susing\sa\svery\slarge\snegative\nLIMIT.
+D 2016-11-30T01:05:41.141
 F Makefile.in 6b572807415d3f0a379cebc9461416d8df4a12c8
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc bb4d970894abbbe0e88d00aac29bd52af8bc95f4
@@ -454,7 +454,7 @@ F src/update.c 1b8321100cac004f0721ab67b16909dd006e663c
 F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c
 F src/util.c 3e2da6101888d073e79ecc6af5e0a2f70fa1e498
 F src/vacuum.c 33c174b28886b2faf26e503b5a49a1c01a9b1c16
-F src/vdbe.c 4a3ff567745aac67ffbb55d06fbecf19f88d12be
+F src/vdbe.c 1802a10926b14de7065950d436e7ce418682faef
 F src/vdbe.h c044be7050ac6bf596eecc6ab159f5dbc020a3b7
 F src/vdbeInt.h 9b498d3cb52dc2efb53571fb8ae8e14cf298ce84
 F src/vdbeapi.c ea4e2dc2213cc6bd7bee375a29a9b51c31b93ae0
@@ -1535,7 +1535,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P d410a839752153c6d8be08f758abfbc16475745a
-R 4de84d6de9c4735ca2171beb11da6949
+P dc453b3403450b1d8cc53daf0721fed025b9053c
+R dc777d9d449bf1af0c4185b27e450723
 U drh
-Z a5d0c3a9dbd00d301630dafcf90b9504
+Z 787a300f5849727b901aee7620134dd8
index f5cb5e6a0de37d20fc924a5df870fff262b00df2..85a66cede42de86a07950336a8175cad2a447d5e 100644 (file)
@@ -1 +1 @@
-dc453b3403450b1d8cc53daf0721fed025b9053c
\ No newline at end of file
+96106d5620eae51474234f4eec1d2c5bd570d486
\ No newline at end of file
index efd069a72eb3b637a1a27a922dfe6fa53edb6ce3..ec92e8b1c0682bd7a10a8ee3c98f8549b4d070d9 100644 (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;
 }