Files
filament/libs
Mathias Agopian f0108247d1 Fix various overflow, truncation, and NEON alignment bugs in bitset.h (#9843)
- Fix constant wrap-around: Define `BIT_COUNT`, `BITS_PER_WORD`, and 
  `WORD_COUNT` (fixed typo from `WORLD_COUNT`) as `size_t` rather than 
  `T` to prevent silent overflows on large bitsets using small integer 
  types.

- Fix NEON `all()` truncation: Remove the generic `T` cast to correctly
  evaluate bounds across the full 64-bit vector lanes.

- Fix non-NEON `count()` overflow: Use a `size_t` accumulator rather 
  than `T` to prevent overflow when counting >255 bits on `uint8_t` 
  parameters.

- Fix NEON strict alignment UB: Enforce unconditional `alignas(16)` on 
  `storage` when `BIT_COUNT` satisfies 128-bit vector multiples, adding 
  a compile-time `static_assert` to ensure ABI expectations match NEON 
  load intrinsics.

- Remove dead masking code inside `firstSetBit()`.
2026-03-27 12:51:40 -07:00
..