bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Fix overflow in `RenderLayers::iter_layers`

Open Azorlogh opened this issue 1 year ago • 0 comments

Objective

  • Fixes overflow when calling RenderLayers::iter_layers on layers of the form k * 64 - 1
    • Causes a panic in debug mode, and an infinite iterator in release mode

Solution

  • Use u64::checked_shr instead of >>=

Testing

  • Added a test case for this: render_layer_iter_no_overflow

Azorlogh avatar Jul 10 '24 11:07 Azorlogh