mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Change the OP_IfNotZero opcode so that it decrements register P1 by 1 rather
than the value in P3, and so that it only decrements if originally positive. This avoids decrementing the smallest 64-bit signed integer. FossilOrigin-Name: 165c044686212fbf7182dd560ad1e57eb4cc9838
This commit is contained in:
14
manifest
14
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Refinements\sto\sthe\snew\sdbfuzz\stest\sprogram.
|
C Change\sthe\sOP_IfNotZero\sopcode\sso\sthat\sit\sdecrements\sregister\sP1\sby\s1\srather\nthan\sthe\svalue\sin\sP3,\sand\sso\sthat\sit\sonly\sdecrements\sif\soriginally\spositive.\nThis\savoids\sdecrementing\sthe\ssmallest\s64-bit\ssigned\sinteger.
|
||||||
D 2016-12-17T21:07:30.972
|
D 2016-12-18T17:42:00.870
|
||||||
F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e
|
F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e
|
||||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||||
F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da
|
F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da
|
||||||
@@ -388,7 +388,7 @@ F src/printf.c f94da4935d1dd25420ac50c6745db1deb35e07c1
|
|||||||
F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
|
F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
|
||||||
F src/resolve.c bb070cf5f23611c44ab7e4788803684e385fc3fb
|
F src/resolve.c bb070cf5f23611c44ab7e4788803684e385fc3fb
|
||||||
F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
|
F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
|
||||||
F src/select.c e4c687333c5fa33b1ce05c37bfbea6e09d3dbee9
|
F src/select.c dfb6cadc3dcfba1b1bdbfba62ebba2b4b673413e
|
||||||
F src/shell.c 95fc9f4cbdfda44f3328ea23d69fb1905a974a90
|
F src/shell.c 95fc9f4cbdfda44f3328ea23d69fb1905a974a90
|
||||||
F src/sqlite.h.in e8e2d108d82647f0a812fdb74accf91c1ec08ddc
|
F src/sqlite.h.in e8e2d108d82647f0a812fdb74accf91c1ec08ddc
|
||||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||||
@@ -455,7 +455,7 @@ F src/update.c 1da7c462110bffed442a42884cb0d528c1db46d8
|
|||||||
F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c
|
F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c
|
||||||
F src/util.c e68e8ced7328f22d2cf7b4c898c394a0de34cdf1
|
F src/util.c e68e8ced7328f22d2cf7b4c898c394a0de34cdf1
|
||||||
F src/vacuum.c 33c174b28886b2faf26e503b5a49a1c01a9b1c16
|
F src/vacuum.c 33c174b28886b2faf26e503b5a49a1c01a9b1c16
|
||||||
F src/vdbe.c 64c3426893e1660bde7446c242468926555e3650
|
F src/vdbe.c 4537452b85817772f159751d6b05799f3f4b09f5
|
||||||
F src/vdbe.h 0c74f6305fb43b9b282dacaff102272370e327d4
|
F src/vdbe.h 0c74f6305fb43b9b282dacaff102272370e327d4
|
||||||
F src/vdbeInt.h 42e498dbe96475dbb3fda3d85d8fd2a87eff60a2
|
F src/vdbeInt.h 42e498dbe96475dbb3fda3d85d8fd2a87eff60a2
|
||||||
F src/vdbeapi.c ea4e2dc2213cc6bd7bee375a29a9b51c31b93ae0
|
F src/vdbeapi.c ea4e2dc2213cc6bd7bee375a29a9b51c31b93ae0
|
||||||
@@ -1539,7 +1539,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
|||||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||||
P ef6e071a62cd79a0edbbef9f41ca9482540e5cb8
|
P 50325abe79b6a79b09ec6a1cee7d80ca02337428
|
||||||
R dc4a1399a03b50b6a494c9549eb51d65
|
R e3435f7f9ecf849784b4c50691f0f18b
|
||||||
U drh
|
U drh
|
||||||
Z 264edff2f6705a86fbfac5952dd5c460
|
Z 8b4cd82f585875ac24b32af2b88bc83b
|
||||||
|
@@ -1 +1 @@
|
|||||||
50325abe79b6a79b09ec6a1cee7d80ca02337428
|
165c044686212fbf7182dd560ad1e57eb4cc9838
|
@@ -596,7 +596,7 @@ static void pushOntoSorter(
|
|||||||
** register is initialized with value of LIMIT+OFFSET.) After the sorter
|
** register is initialized with value of LIMIT+OFFSET.) After the sorter
|
||||||
** fills up, delete the least entry in the sorter after each insert.
|
** fills up, delete the least entry in the sorter after each insert.
|
||||||
** Thus we never hold more than the LIMIT+OFFSET rows in memory at once */
|
** Thus we never hold more than the LIMIT+OFFSET rows in memory at once */
|
||||||
addr = sqlite3VdbeAddOp3(v, OP_IfNotZero, iLimit, 0, 1); VdbeCoverage(v);
|
addr = sqlite3VdbeAddOp1(v, OP_IfNotZero, iLimit); VdbeCoverage(v);
|
||||||
sqlite3VdbeAddOp1(v, OP_Last, pSort->iECursor);
|
sqlite3VdbeAddOp1(v, OP_Last, pSort->iECursor);
|
||||||
if( pSort->bOrderedInnerLoop ){
|
if( pSort->bOrderedInnerLoop ){
|
||||||
r1 = ++pParse->nMem;
|
r1 = ++pParse->nMem;
|
||||||
|
12
src/vdbe.c
12
src/vdbe.c
@@ -6012,20 +6012,20 @@ case OP_OffsetLimit: { /* in1, out2, in3 */
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Opcode: IfNotZero P1 P2 P3 * *
|
/* Opcode: IfNotZero P1 P2 * * *
|
||||||
** Synopsis: if r[P1]!=0 then r[P1]-=P3, goto P2
|
** Synopsis: if r[P1]!=0 then r[P1]--, goto P2
|
||||||
**
|
**
|
||||||
** Register P1 must contain an integer. If the content of register P1 is
|
** Register P1 must contain an integer. If the content of register P1 is
|
||||||
** initially nonzero, then subtract P3 from the value in register P1 and
|
** initially greater than zero, then decrement the value in register P1.
|
||||||
** jump to P2. If register P1 is initially zero, leave it unchanged
|
** If it is non-zero (negative or positive) and then also jump to P2.
|
||||||
** and fall through.
|
** If register P1 is initially zero, leave it unchanged and fall through.
|
||||||
*/
|
*/
|
||||||
case OP_IfNotZero: { /* jump, in1 */
|
case OP_IfNotZero: { /* jump, in1 */
|
||||||
pIn1 = &aMem[pOp->p1];
|
pIn1 = &aMem[pOp->p1];
|
||||||
assert( pIn1->flags&MEM_Int );
|
assert( pIn1->flags&MEM_Int );
|
||||||
VdbeBranchTaken(pIn1->u.i<0, 2);
|
VdbeBranchTaken(pIn1->u.i<0, 2);
|
||||||
if( pIn1->u.i ){
|
if( pIn1->u.i ){
|
||||||
pIn1->u.i -= pOp->p3;
|
if( pIn1->u.i>0 ) pIn1->u.i--;
|
||||||
goto jump_to_p2;
|
goto jump_to_p2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user