-
Notifications
You must be signed in to change notification settings - Fork 84
Open
Labels
Description
Hey, while running in debug mode I got a panic in the astar implmentation due to overflow.
thread 'Async Compute Task Pool (0)' panicked at /Users/choc/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pathfinding-4.10.0/src/directed/astar.rs:140:33:
attempt to add with overflow
pathfinding/src/directed/astar.rs
Line 140 in 2aa2326
| estimated_cost: new_cost + h, |
I probably have some pathological setup, but for correctness the estimated cost should probably saturate instead of wrapping. Thoughts on using new_cost.saturating_add(h) ?