From 0bce8612a5b72188011b5c97f019de08c2912745 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 19 Aug 2010 13:28:02 +0000 Subject: [PATCH] Fix for SIGSEGV on Mandriva2008 in optimize mode only ==21300== Invalid read of size 4 ==21300== at 0x1445EA23: StdMeshers_Penta_3D::MakeVolumeMesh() (StdMeshers_Penta_3D.cxx:681) while (aItNodes->more()) { It seems to be an error of optimization, aItNodes.px becomes invalid before aItNodes->more() returns false but after the loop code is performed for the last time. --- src/StdMeshers/StdMeshers_Penta_3D.cxx | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Penta_3D.cxx b/src/StdMeshers/StdMeshers_Penta_3D.cxx index bdab94ece..b9d46da9e 100644 --- a/src/StdMeshers/StdMeshers_Penta_3D.cxx +++ b/src/StdMeshers/StdMeshers_Penta_3D.cxx @@ -676,22 +676,16 @@ void StdMeshers_Penta_3D::MakeVolumeMesh() if ( aN.size() < nbFaceNodes * 2 ) aN.resize( nbFaceNodes * 2 ); // - k=0; - aItNodes=pE0->nodesIterator(); - while (aItNodes->more()) { - //const SMDS_MeshElement* pNode = aItNodes->next(); - const SMDS_MeshNode* pNode = - static_cast (aItNodes->next()); - if(myTool->IsMedium(pNode)) - continue; + for ( k=0; kGetNode(k); +// if(myTool->IsMedium(pNode)) +// continue; aID0 = pNode->GetID(); aJ[k] = GetIndexOnLayer(aID0); if (!myErrorStatus->IsOK()) { MESSAGE("StdMeshers_Penta_3D::MakeVolumeMesh"); return; } - // - ++k; } // bool forward = true; -- 2.39.2