From ae296d66860891062b0704fb90d877d49b5176d3 Mon Sep 17 00:00:00 2001 From: chr Date: Sat, 23 May 2015 14:55:26 +0000 Subject: [PATCH] Fixed typo in delete_connection routine. git-svn-id: https://codeforge.lbl.gov/anonscm/voro@583 6221c96e-593b-4ce1-a500-64c4038a1943 --- trunk/NEWS | 3 +++ trunk/src/cell.cc | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/trunk/NEWS b/trunk/NEWS index 69b16b0..44fe607 100644 --- a/trunk/NEWS +++ b/trunk/NEWS @@ -10,6 +10,9 @@ Version 0.5 (...) changing config.hh could create a problem. * Updated plane cutting routine to handle non-convex cases. This should remove some extremely rare errors where cells can accidentally be deleted. +* Fixed a typo in the delete_connection routine in cell.cc that could cause + segmentation faults in extremely rare cases. Thanks to Francesco Biscani (Max + Planck institute for Astronomy, Heidelberg) for pointing this out. * Cleaned up comments * Updated Doxyfile to 1.8.9.1 diff --git a/trunk/src/cell.cc b/trunk/src/cell.cc index 836be7d..d0340fa 100644 --- a/trunk/src/cell.cc +++ b/trunk/src/cell.cc @@ -1499,9 +1499,9 @@ bool voronoicell_base::delete_connection(vc_class &vc,int j,int k,bool hand) { edd=mep[nu[j]]+((nu[j]<<1)+1)*--mec[nu[j]]; for(l=0;l<=(nu[j]<<1);l++) ed[j][l]=edd[l]; vc.n_set_aux2_copy(j,nu[j]); - vc.n_set_to_aux2(edd[nu[j]<<1]); + vc.n_copy_pointer(edd[nu[j]<<1],j); vc.n_set_to_aux1(j); - ed[edd[nu[j]<<1]]=edd; + ed[edd[nu[j]<<1]]=ed[j]; ed[j]=edp; nu[j]=i; return true; -- 2.11.4.GIT