From 693206c2422b4a49bc284b3f43068dd6a6f99fb1 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 5 Jun 2024 17:02:13 +0200 Subject: [PATCH] fix the UBSAN error ``` include/CGAL/Poisson_reconstruction_function.h:263:70: runtime error: reference binding to null pointer of type 'struct value_type' ``` --- .../include/CGAL/Poisson_reconstruction_function.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h index 68c71a27151..ae2544567d7 100644 --- a/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h +++ b/Poisson_surface_reconstruction_3/include/CGAL/Poisson_reconstruction_function.h @@ -260,7 +260,10 @@ class Poisson_reconstruction_function Cell_handle get() const { - return Triangulation_data_structure::Cell_range::s_iterator_to(*m_cell); + if(m_cell == nullptr) + return {}; + else + return Triangulation_data_structure::Cell_range::s_iterator_to(*m_cell); } void set (Cell_handle ch) { m_cell = ch.operator->(); } };