`&*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.
This commit is contained in:
Laurent Rineau 2018-09-17 15:44:01 +02:00
parent f8a37e59ef
commit f9c9cfa40b
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}