From: eap Date: Thu, 19 Aug 2010 13:28:02 +0000 (+0000) Subject: Fix for SIGSEGV on Mandriva2008 in optimize mode only X-Git-Tag: end_translate_resources_09Jul10~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0bce8612a5b72188011b5c97f019de08c2912745;p=modules%2Fsmesh.git 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. --- 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;