Re: [PATCH v3 4/6] xdiff/xdl_cleanup_records: make limits more clear
- From
Ezekiel Newren <ezekielnewren@gmail.com>
- Date
- Mar 30, 2026, 16:00 UTC
- Message-ID
- <CAH=ZcbAKwtq9jiv=XWi_P0ZD1hz7XEpEtMPONB9n=_EcOPPSRg@mail.gmail.com>
- In-Reply-To
- <xmqqcy0oj2s1.fsf@gitster.g>
On Fri, Mar 27, 2026 at 5:01 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Updated code, when nm is not zero, does something different. if > need_min is true, mlim1 is set to -1 and presumably nm is a count or > length that is bounded on its lower end with 0, so it is larger than > mlim1 (== -1), and we always take INVESTIGATE and never KEEP. > > So the rewritten code is broken when need_min is true? > > I suspect the remainder of the patch is broken exactly the same way, > so the remedy would be similar?
Your assessment is correct, PTRDIFF_MAX should be used instead of SIZE_MAX. I realized my mistake a few hours after I pushed. This will be fixed in the next version.