diff options
author | drh <drh@noemail.net> | 2016-12-18 17:42:00 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-12-18 17:42:00 +0000 |
commit | f99dd359d00fd5af78d8ccb4b7c27fc82f578ddb (patch) | |
tree | 008f571f1ff819a7f2bede0443f4ec08f064b8d8 /src/select.c | |
parent | 22d709dd911129e2e657d0f6e6bd132ea5f3b0a4 (diff) | |
download | sqlite-f99dd359d00fd5af78d8ccb4b7c27fc82f578ddb.tar.gz sqlite-f99dd359d00fd5af78d8ccb4b7c27fc82f578ddb.zip |
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
Diffstat (limited to 'src/select.c')
-rw-r--r-- | src/select.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c index 18344b7d4..e5f4c7fcd 100644 --- a/src/select.c +++ b/src/select.c @@ -596,7 +596,7 @@ static void pushOntoSorter( ** register is initialized with value of LIMIT+OFFSET.) After the sorter ** 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 */ - addr = sqlite3VdbeAddOp3(v, OP_IfNotZero, iLimit, 0, 1); VdbeCoverage(v); + addr = sqlite3VdbeAddOp1(v, OP_IfNotZero, iLimit); VdbeCoverage(v); sqlite3VdbeAddOp1(v, OP_Last, pSort->iECursor); if( pSort->bOrderedInnerLoop ){ r1 = ++pParse->nMem; |