Merge pull request #4700 from lrineau/Mesh_3-fix_UBSAN_error_binding_ref_to_null_pointer-GF

Fix UBSAN error: do not bind reference to null pointer
This commit is contained in:
Sebastien Loriot 2020-05-12 16:54:53 +02:00 committed by GitHub
commit 0ccdbf8aff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -408,7 +408,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;
}
@ -421,10 +421,10 @@ public:
void set_neighbors(Cell_handle n0, Cell_handle n1,
Cell_handle n2, Cell_handle n3)
{
CGAL_triangulation_precondition( this != &*n0 );
CGAL_triangulation_precondition( this != &*n1 );
CGAL_triangulation_precondition( this != &*n2 );
CGAL_triangulation_precondition( this != &*n3 );
CGAL_triangulation_precondition( this != n0.operator->() );
CGAL_triangulation_precondition( this != n1.operator->() );
CGAL_triangulation_precondition( this != n2.operator->() );
CGAL_triangulation_precondition( this != n3.operator->() );
N[0] = n0;
N[1] = n1;
N[2] = n2;

View File

@ -190,10 +190,10 @@ public:
void set_neighbors(Cell_handle n0, Cell_handle n1,
Cell_handle n2, Cell_handle n3)
{
CGAL_triangulation_precondition( this != &*n0 );
CGAL_triangulation_precondition( this != &*n1 );
CGAL_triangulation_precondition( this != &*n2 );
CGAL_triangulation_precondition( this != &*n3 );
CGAL_triangulation_precondition( this != n0.operator->() );
CGAL_triangulation_precondition( this != n1.operator->() );
CGAL_triangulation_precondition( this != n2.operator->() );
CGAL_triangulation_precondition( this != n3.operator->() );
N[0] = n0;
N[1] = n1;
N[2] = n2;