Skip to content

nir/search: Use larger type to hold linearized index

Ian Romanick requested to merge idr/mesa:review/fix-index-overflow into master

index is an offset into a linearized 3-dimensional array. Starting with fbd5359a, the 3-dimensional array can have 43 elements in each dimension. 43**3 = 79507, and that will overflow the uint16_t.

See also the discussion in MR !3765.

Fixes: fbd5359a ("nir/algebraic: Rearrange bcsel sequences generated by nir_opt_peephole_select")
Suggested-by: Connor Abbott cwabbott0@gmail.com

Merge request reports