fix segmentation fault for via-routes with invalid intermediate segments
This commit is contained in:
parent
9f6859561c
commit
766e2713ab
@ -8,6 +8,8 @@
|
||||
- API:
|
||||
- `annotations=true` now returns the data source id for each segment as `datasources`
|
||||
- Reduced semantic of merge to refer only to merges from a lane onto a motorway-like road
|
||||
- Bugfixes
|
||||
- Fixed an issue that would result in segfaults for viaroutes with an invalid intermediate segment when u-turns were allowed at the via-location
|
||||
|
||||
# 5.3.0
|
||||
Changes from 5.3.0-rc.3
|
||||
|
@ -277,3 +277,20 @@ Feature: Via points
|
||||
When I route I should get
|
||||
| from | to | route |
|
||||
| e | f | ebbdcf,ebbdcf |
|
||||
|
||||
@2798
|
||||
Scenario: UTurns Enabled
|
||||
Given the node map
|
||||
| a | b | c | d | e |
|
||||
|
||||
And the query options
|
||||
| continue_straight | false |
|
||||
|
||||
And the ways
|
||||
| nodes | oneway |
|
||||
| abc | yes |
|
||||
| edc | yes |
|
||||
|
||||
When I route I should get
|
||||
| waypoints | route |
|
||||
| a,b,e | |
|
||||
|
@ -114,6 +114,10 @@ class ShortestPathRouting final
|
||||
needs_loop_forwad,
|
||||
needs_loop_backwards);
|
||||
}
|
||||
// if no route is found between two parts of the via-route, the entire route becomes
|
||||
// invalid. Adding to invalid edge weight sadly doesn't return an invalid edge weight. Here
|
||||
// we prevent the possible overflow, faking the addition of infinity + x == infinity
|
||||
if (new_total_distance != INVALID_EDGE_WEIGHT)
|
||||
new_total_distance += std::min(total_distance_to_forward, total_distance_to_reverse);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user