From f9c9cfa40bdad5c5f250e4d600c43aa2f0d50021 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 17 Sep 2018 15:44:01 +0200 Subject: [PATCH] `&*handle`, if handle is null, is undefined-behavior This patch fixes an undefined behavior: when one want to convert a handle to a point, we used `&*handle` a lot. But dereferencing the default-constructed (null) handle, is undefined-behavior. The patch calls `operator->` of the handle class, instead. --- TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h b/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h index b8046fa77af..38726c9fa30 100644 --- a/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h +++ b/TDS_3/include/CGAL/Triangulation_ds_cell_base_3.h @@ -164,7 +164,7 @@ public: void set_neighbor(int i, Cell_handle n) { CGAL_triangulation_precondition( i >= 0 && i <= 3); - CGAL_triangulation_precondition( this != &*n ); + CGAL_triangulation_precondition( this != n.operator->() ); N[i] = n; }