[osrm] 01/04: Imported Upstream version 5.2.5+ds
Bas Couwenberg
sebastic at debian.org
Thu Jun 23 11:40:54 UTC 2016
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository osrm.
commit 3cad9df0a9b901ca56552c441b399f5cab9f929f
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Thu Jun 23 07:01:28 2016 +0200
Imported Upstream version 5.2.5+ds
---
CHANGELOG.md | 4 ++++
CMakeLists.txt | 2 +-
features/step_definitions/data.js | 2 +-
features/testbot/fixed.feature | 15 +++++++++++++++
src/engine/guidance/post_processing.cpp | 4 ++--
5 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6007991..e11f4ff 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 5.2.5
+ - Bugfixes
+ - Fixes a segfault caused by incorrect trimming logic for very short steps.
+
# 5.2.4
Changes from 5.2.3:
- Bugfixes:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6d02a17..3fe7b43 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,7 @@ endif()
project(OSRM C CXX)
set(OSRM_VERSION_MAJOR 5)
set(OSRM_VERSION_MINOR 2)
-set(OSRM_VERSION_PATCH 0)
+set(OSRM_VERSION_PATCH 5)
# these two functions build up custom variables:
# OSRM_INCLUDE_PATHS and OSRM_DEFINES
diff --git a/features/step_definitions/data.js b/features/step_definitions/data.js
index bb58b85..58a3fc5 100644
--- a/features/step_definitions/data.js
+++ b/features/step_definitions/data.js
@@ -17,7 +17,7 @@ module.exports = function () {
this.setContractArgs(args, callback);
});
- this.Given(/^a grid size of (\d+) meters$/, (meters, callback) => {
+ this.Given(/^a grid size of ([0-9.]+) meters$/, (meters, callback) => {
this.setGridSize(meters);
callback();
});
diff --git a/features/testbot/fixed.feature b/features/testbot/fixed.feature
index dc09eaa..1499eba 100644
--- a/features/testbot/fixed.feature
+++ b/features/testbot/fixed.feature
@@ -24,3 +24,18 @@ Feature: Fixed bugs, kept to check for regressions
When I route I should get
| from | to | route |
| x | y | abc,abc |
+
+ Scenario: Step trimming with very short segments
+ Given a grid size of 0.1 meters
+ Given the node map
+ | a | 1 | b | c | d | 2 | e |
+
+ Given the ways
+ | nodes | oneway |
+ | ab | yes |
+ | bcd | yes |
+ | de | yes |
+
+ When I route I should get
+ | from | to | route |
+ | 1 | 2 | bcd,bcd |
diff --git a/src/engine/guidance/post_processing.cpp b/src/engine/guidance/post_processing.cpp
index 5731a1a..e593a7e 100644
--- a/src/engine/guidance/post_processing.cpp
+++ b/src/engine/guidance/post_processing.cpp
@@ -928,13 +928,13 @@ void trimShortSegments(std::vector<RouteStep> &steps, LegGeometry &geometry)
auto &next_to_last_step = *(steps.end() - 2);
// in the end, the situation with the roundabout cannot occur. As a result, we can remove
// all zero-length instructions
- if (next_to_last_step.distance <= 1)
+ if (next_to_last_step.distance <= 1 && steps.size() > 2)
{
geometry.locations.pop_back();
geometry.annotations.pop_back();
geometry.osm_node_ids.pop_back();
geometry.segment_offsets.pop_back();
- BOOST_ASSERT(geometry.segment_distances.back() < 1);
+ BOOST_ASSERT(geometry.segment_distances.back() <= 1);
geometry.segment_distances.pop_back();
next_to_last_step.maneuver.waypoint_type = WaypointType::Arrive;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osrm.git
More information about the Pkg-grass-devel
mailing list