From 084cdc37971f3be522a0c677e4fe02cb09b6b7c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Fri, 24 May 2019 08:24:38 +0200 Subject: [PATCH] Fix order of checks to avoid calling back() on an empty vector --- .../include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h b/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h index 2bd8191b5b4..439705a116f 100644 --- a/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h +++ b/Intersections_2/include/CGAL/Triangle_2_Iso_rectangle_2_intersection.h @@ -271,7 +271,7 @@ namespace CGAL{ namespace internal { typename std::vector::iterator last = std::unique(result.begin(),result.end()); result.erase(last,result.end()); - while(result.back() == result.front() && result.size() > 1) + while(result.size() > 1 && result.back() == result.front()) result.pop_back(); switch(result.size()){