From 8b920254c26a1d5a323bbc1106572bbda5135939 Mon Sep 17 00:00:00 2001 From: Adam Wulkiewicz Date: Mon, 4 Mar 2024 20:19:06 +0100 Subject: [PATCH] [line_interpolate] Fix infinite loop --- include/boost/geometry/algorithms/line_interpolate.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/boost/geometry/algorithms/line_interpolate.hpp b/include/boost/geometry/algorithms/line_interpolate.hpp index 00e847d36c..9afbe5092c 100644 --- a/include/boost/geometry/algorithms/line_interpolate.hpp +++ b/include/boost/geometry/algorithms/line_interpolate.hpp @@ -1,6 +1,6 @@ // Boost.Geometry (aka GGL, Generic Geometry Library) -// Copyright (c) 2023 Adam Wulkiewicz, Lodz, Poland. +// Copyright (c) 2023-2024 Adam Wulkiewicz, Lodz, Poland. // Copyright (c) 2018-2023 Oracle and/or its affiliates. // Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle @@ -135,7 +135,11 @@ struct interpolate_range p, diff_distance); Policy::apply(p, pointlike); - if BOOST_GEOMETRY_CONSTEXPR (util::is_multi::value) + if BOOST_GEOMETRY_CONSTEXPR (util::is_point::value) + { + return; + } + else // else prevents unreachable code warning { start_p = p; prev_distance = repeated_distance;