diff --git a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h index 2f15ce3be76..0d67815ab7d 100644 --- a/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h +++ b/Homogeneous_kernel/include/CGAL/Homogeneous/function_objects.h @@ -4716,22 +4716,30 @@ namespace HomogeneousKernelFunctors { { typename K::Construct_source_2 source; typename K::Construct_target_2 target; + typename K::Construct_vertex_2 vertex; typename K::Construct_circumcenter_2 circumcenter; typename K::Orientation_2 orientation; - const Point_2 a = source(s); - const Point_2 b = target(s); + const Point_2& a = source(s); + const Point_2& b = target(s); + CGAL_assertion(a != b); + + const Point_2& p0 = vertex(t, 0); + const Point_2& p1 = vertex(t, 1); + const Point_2& p2 = vertex(t, 2); + CGAL_assertion(p0 != p1 && p1 != p2 && p2 != p0); + const Point_2 cc = circumcenter(t); CGAL::Orientation o_abc = orientation(a, b, cc); if (o_abc == CGAL::COLLINEAR) return CGAL::ON_ORIENTED_BOUNDARY; - CGAL::Orientation o_abt = orientation(a, b, t[0]); + CGAL::Orientation o_abt = orientation(a, b, p0); if (o_abt == CGAL::COLLINEAR) - o_abt = orientation(a, b, t[1]); + o_abt = orientation(a, b, p1); if (o_abt == CGAL::COLLINEAR) - o_abt = orientation(a, b, t[2]); + o_abt = orientation(a, b, p2); CGAL_assertion(o_abt != CGAL::COLLINEAR); if (o_abc == o_abt) return CGAL::ON_POSITIVE_SIDE;