From 163ef2500658d24653eb588c4cf25bd0aec1d0d4 Mon Sep 17 00:00:00 2001 From: ika Date: Fri, 8 Feb 2013 14:56:38 +0400 Subject: [PATCH] 0023722: stack overflow during reading IGES in Test Harness Add creation a new vertex before replace. Adding of test cases for CR23722 --- src/ShapeFix/ShapeFix_IntersectionTool.cxx | 33 +++++++++++----------- tests/bugs/heal/bug23722 | 13 +++++++++ 2 files changed, 30 insertions(+), 16 deletions(-) create mode 100755 tests/bugs/heal/bug23722 diff --git a/src/ShapeFix/ShapeFix_IntersectionTool.cxx b/src/ShapeFix/ShapeFix_IntersectionTool.cxx index ad65d7a9c7..8b785181fa 100755 --- a/src/ShapeFix/ShapeFix_IntersectionTool.cxx +++ b/src/ShapeFix/ShapeFix_IntersectionTool.cxx @@ -1226,30 +1226,31 @@ Standard_Boolean ShapeFix_IntersectionTool::FixSelfIntersectWire TopoDS_Edge tmpE,SegE; // split edge1 Standard_Integer akey1=0, akey2=0; + Standard_Real newTolerance; // analysis fo P01 - if(P01.Distance(PV1)BRep_Tool::Tolerance(V1)) - B.UpdateVertex(NewV1,tolV1); + newTolerance = Max(tolV1,BRep_Tool::Tolerance(V1)); + if(P01.Distance(PV1)BRep_Tool::Tolerance(V2)) - B.UpdateVertex(NewV1,tolV1); + newTolerance = Max(tolV1,BRep_Tool::Tolerance(V2)); + if(P01.Distance(PV2)BRep_Tool::Tolerance(V1)) - B.UpdateVertex(NewV2,tolV2); + newTolerance = Max(tolV2,BRep_Tool::Tolerance(V1)); + if(P02.Distance(PV1)BRep_Tool::Tolerance(V2)) - B.UpdateVertex(NewV2,tolV2); + newTolerance = Max(tolV2,BRep_Tool::Tolerance(V2)); + if(P02.Distance(PV2)1 || akey2>1 ) continue; diff --git a/tests/bugs/heal/bug23722 b/tests/bugs/heal/bug23722 new file mode 100755 index 0000000000..0afa733714 --- /dev/null +++ b/tests/bugs/heal/bug23722 @@ -0,0 +1,13 @@ +puts "========" +puts "CR23722" +puts "========" +puts "" +############################# +## stack overflow during reading IGES in Test Harness +############################# + +restore [locate_data_file bug23722_face.brep] + +brepiges bug23722_face ${imagedir}/face.igs + +igesbrep ${imagedir}/face.igs a *