• Bug#1109782: unblock: 7zip/25.00+dfsg-1 (3/13)

    From Bastian Germann@21:1/5 to All on Wed Jul 23 19:40:02 2025
    [continued from previous message]

    const UInt32 delta = pos - curMatch;
    {
    - CLzRef *pair = son + ((size_t)(_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
    + CLzRef *pair = son + ((size_t)(_cyclicBufferPos - delta + (_cyclicBufferPos < delta ? _cyclicBufferSize : 0)) << 1);
    const Byte *pb = cur - delta;
    unsigned len = (len0 < len1 ? len0 : len1);
    if (pb[len] == cur[len])
    @@ -1595,7 +1595,7 @@
    UInt32 pos = p->pos; \
    UInt32 num2 = num; \
    /* (p->pos == p->posLimit) is not allowed here !!! */ \
    - { const UInt32 rem = p->posLimit - pos; if (num2 > rem) num2 = rem; } \
    + { const UInt32 rem = p->posLimit - pos; if (num2 >= rem) num2 = rem; } \
    num -= num2; \
    { const UInt32 cycPos = p->cyclicBufferPos; \
    son = p->son + cycPos; \
    diff -Nru 7zip-24.09+dfsg/C/LzFindMt.c 7zip-25.00+dfsg/C/LzFindMt.c
    --- 7zip-24.09+dfsg/C/LzFindMt.c 2024-01-22 15:00:00.000000000 +0100
    +++ 7zip-25.00+dfsg/C/LzFindMt.c 2025-06-30 18:00:00.000000000 +0200
    @@ -1,5 +1,5 @@
    /* LzFindMt.c -- multithreaded Match finder for LZ algorithms
    -2024-01-22 : Igor Pavlov : Public domain */
    +: Igor Pavlov : Public domain */

    #include "Precomp.h"

    @@ -82,6 +82,8 @@
    Z7_NO_INLINE
    static void MtSync_Construct(CMtSync *p)
    {
    + p->affinityGroup = -1;
    + p->affinityInGroup = 0;
    p->affinity = 0;
    p->wasCreated = False;
    p->csWasInitialized = False;
    @@ -259,6 +261,12 @@
    // return ERROR_TOO_MANY_POSTS; // for debug
    // return EINVAL; // for debug

    +#ifdef _WIN32
    + if (p->affinityGroup >= 0)
    + wres = Thread_Create_With_Group(&p->thread, startAddress, obj,
    + (unsigned)(UInt32)p->affinityGroup, (CAffinityMask)p->affinityInGroup);
    + else
    +#endif
    if (p->affinity != 0)
    wres = Thread_Create_With_Affinity(&p->thread, startAddress, obj, (CAffinityMask)p->affinity);
    else
    diff -Nru 7zip-24.