From d2ccbc59c3d68ae73aa4e68eb43077df7efd9431 Mon Sep 17 00:00:00 2001 From: Panagiotis Cheilaris Date: Thu, 26 Jul 2012 19:42:57 +0300 Subject: [PATCH] bugfix for vertex conflict (pqt) The pnt_on_seg variable was used uninitialized in some cases. Here is a previously problematic input that now works fine: $ cat ~/code/geom/demo/Segment_Delaunay_graph_Linf_2/2a2across.cin s -150 -50 150 50 s -50 100 50 -100 --- .../CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h b/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h index 449fd466c58..e1ceb4622f0 100644 --- a/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h +++ b/include/CGAL/Segment_Delaunay_graph_Linf_2/Vertex_conflict_C2.h @@ -1121,6 +1121,7 @@ private: if (is_same_qsrc_p or is_same_qtrg_p) { std::cout << "debug: pss: p is endpoint of q" << std::endl; + pnt_on_seg = pnt; Point_2 otherpnt; if (is_same_qsrc_p) { otherpnt = seg.target(); @@ -1143,7 +1144,6 @@ private: std::cout << "debug: pss from pt to pt on seg" << std::endl; - Point_2 pnt_on_seg; if (is_positive_slope) { pnt_on_seg = compute_vertical_projection(l, pnt); lver = compute_line_from_to(pnt, pnt_on_seg); @@ -1227,6 +1227,9 @@ private: // here p and t have common endpoint testt + std::cout << "debug testt=" << testt + << " pnt_on_seg=" << pnt_on_seg << std::endl; + // check if testp equals pnt_on_seg if ((cmpx(testt, pnt_on_seg) == EQUAL ) and