You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a program that generates random shapes and inserts them into a RTree. I accidentally generated some shapes that contained NaN and to my surprise, the program panicked. The panic occurred inside rstar.
Here a minimal example that I've tested with rstar 0.10.0
use rstar::{RTree, primitives::Rectangle};fnmain(){letmut tree = RTree::new();
tree.insert(Rectangle::from_corners([-1.4,1.0],[-1.3,1.1]));
tree.insert(Rectangle::from_corners([2.3,0.0],[2.4,0.0]));
tree.insert(Rectangle::from_corners([-1.4, -0.4],[-1.4, -0.2]));
tree.insert(Rectangle::from_corners([f32::NAN, f32::NAN],[f32::NAN, f32::NAN]));
tree.insert(Rectangle::from_corners([1.8, -1.8],[1.9, -1.8]));
tree.insert(Rectangle::from_corners([0.2, -0.5],[0.3, -0.4]));
tree.insert(Rectangle::from_corners([-0.6, -0.6],[-0.4, -0.5]));// This will panic!}
Output:
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/explorer/.cargo/registry/src/github.com-1ecc6299db9ec823/rstar-0.10.0/src/algorithm/rstar.rs:345:14
I wrote a program that generates random shapes and inserts them into a
RTree
. I accidentally generated some shapes that contained NaN and to my surprise, the program panicked. The panic occurred inside rstar.Here a minimal example that I've tested with rstar 0.10.0
Output:
Rust explorer link
Is this intentional behavior?
The text was updated successfully, but these errors were encountered: