From 5ec98007b99725ad730f536d7db8c9a89630eea8 Mon Sep 17 00:00:00 2001 From: jthorn Date: Fri, 2 May 2003 18:54:28 +0000 Subject: This patch fixes a bug in void Misner_standard(CCTK_ARGUMENTS) where setting ADMBase::metric_type = "static conformal" StaticConformal::conformal_storage = "factor" led to the local flag make_conformal_derivs never being initialized. Alas, later code then tested this flag, and if the random garbage that's in uninitialized memory happened to be nonzero, the later code would then proceed to try to initialize the 1st derivatives of the conformal factor. Since these don't have storage allocated, this core-dumps. :( :( The bug is fixed by changing the logic to always set make_conformal_derivs . git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/IDAnalyticBH/trunk@127 6a3ddf76-46e1-4315-99d9-bc56cac1ef84 --- src/Misner_standard.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Misner_standard.c b/src/Misner_standard.c index cb14618..f5d8417 100644 --- a/src/Misner_standard.c +++ b/src/Misner_standard.c @@ -86,18 +86,27 @@ void Misner_standard(CCTK_ARGUMENTS) /* Check if we should create and store conformal factor stuff */ if(CCTK_EQUALS(metric_type, "static conformal")) { - *conformal_state = 1; - - if(CCTK_EQUALS(conformal_storage,"factor+derivs")) + if (CCTK_EQUALS(conformal_storage,"factor")) + { + *conformal_state = 1; + make_conformal_derivs = 0; + } + else if (CCTK_EQUALS(conformal_storage,"factor+derivs")) { *conformal_state = 2; make_conformal_derivs = 1; } - else if(CCTK_EQUALS(conformal_storage,"factor+derivs+2nd derivs")) + else if (CCTK_EQUALS(conformal_storage,"factor+derivs+2nd derivs")) { *conformal_state = 3; make_conformal_derivs = 1; } + else + { + CCTK_VWarn(0, __LINE__, __FILE__, CCTK_THORNSTRING, +"Misner_Standard(): impossible value for conformal_storage=\"%s\"!"); + /*NOTREACHED*/ + } } else { -- cgit v1.2.3