[PATCH master 1/2] range: fix corner cases when exclusive end is zero

Sascha Hauer s.hauer at pengutronix.de
Mon Nov 3 00:40:38 PST 2025


On Sat, 01 Nov 2025 11:55:38 +0100, Ahmad Fatoum wrote:
> Unlike inclusive ranges, exclusive ranges can be empty and
> region_overlap_end_exclusive() goes beyond that and checks that ranges
> are neither empty nor does the end precede the start.
> 
> This is problematic for a range that stretches to the maximum value of a
> type. Exclusive end in that case would be 0 and 0 comes before all
> non-zero numbers, so the region_overlap_end_exclusive() would always
> return false.
> 
> [...]

Applied, thanks!

[1/2] range: fix corner cases when exclusive end is zero
      https://git.pengutronix.de/cgit/barebox/commit/?id=8ec4f2589cd3 (link may not be stable)
[2/2] test: self: add range.h test
      https://git.pengutronix.de/cgit/barebox/commit/?id=510c2391d2ab (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer at pengutronix.de>




More information about the barebox mailing list