1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0031876: Configuration - Prs3d_Arrow::DrawShaded() crashes in msvc10 win32 Release build

Use longer code syntax to workaround compiler bug.
This commit is contained in:
kgv 2020-10-24 21:01:50 +03:00 committed by bugmaster
parent f41fd243b6
commit ec4128df29

View File

@ -138,9 +138,18 @@ Handle(Graphic3d_ArrayOfTriangles) Prs3d_Arrow::DrawShaded (const gp_Ax1&
return Handle(Graphic3d_ArrayOfTriangles)();
}
Standard_Integer aMaxVertexs = (aNbTrisTube > 0 ? Prs3d_ToolCylinder::VerticesNb (theNbFacettes, 1) : 0)
+ (aNbTrisCone > 0 ? Prs3d_ToolDisk ::VerticesNb (theNbFacettes, 1)
+ Prs3d_ToolCylinder::VerticesNb (theNbFacettes, 1) : 0);
Standard_Integer aMaxVertexs = 0;
if (aNbTrisTube > 0)
{
aMaxVertexs += Prs3d_ToolCylinder::VerticesNb (theNbFacettes, 1);
}
if (aNbTrisCone > 0)
{
// longer syntax to workaround msvc10 32-bit optimizer bug (#0031876)
aMaxVertexs += Prs3d_ToolDisk::VerticesNb (theNbFacettes, 1);
aMaxVertexs += Prs3d_ToolCylinder::VerticesNb (theNbFacettes, 1);
}
Handle(Graphic3d_ArrayOfTriangles) anArray = new Graphic3d_ArrayOfTriangles (aMaxVertexs, aNbTris * 3, Graphic3d_ArrayFlags_VertexNormal);
if (aNbTrisTube != 0)
{