0024989: Visualization - workaround vc12 32-bit compiler optimizer bug resulted in...
authorsan <san@opencascade.com>
Wed, 11 Jun 2014 06:45:17 +0000 (10:45 +0400)
committerapn <apn@opencascade.com>
Wed, 11 Jun 2014 06:45:56 +0000 (10:45 +0400)
Test case for issue CR24989

src/AIS/AIS_Axis.cxx
tests/bugs/vis/bug24989 [new file with mode: 0755]

index 7f7d511..49d59f4 100644 (file)
@@ -261,10 +261,11 @@ void AIS_Axis::ComputeFields()
   if (myIsXYZAxis){
     // calcul de myPFirst,myPlast
     Handle(Prs3d_DatumAspect) DA = myDrawer->DatumAspect();
   if (myIsXYZAxis){
     // calcul de myPFirst,myPlast
     Handle(Prs3d_DatumAspect) DA = myDrawer->DatumAspect();
-    gp_Pnt Orig = myAx2->Ax2().Location();
-    gp_Dir oX = myAx2->Ax2().XDirection();
-    gp_Dir oY = myAx2->Ax2().YDirection();
-    gp_Dir oZ = myAx2->Ax2().Direction();
+    gp_Ax2 anAxis = myAx2->Ax2();
+    const gp_Pnt& Orig = anAxis.Location();
+    const gp_Dir& oX   = anAxis.XDirection();
+    const gp_Dir& oY   = anAxis.YDirection();
+    const gp_Dir& oZ   = anAxis.Direction();
     Quantity_Length xo,yo,zo,x = 0.,y = 0.,z = 0.;
     Orig.Coord(xo,yo,zo);
     myPfirst.SetCoord(xo,yo,zo);
     Quantity_Length xo,yo,zo,x = 0.,y = 0.,z = 0.;
     Orig.Coord(xo,yo,zo);
     myPfirst.SetCoord(xo,yo,zo);
diff --git a/tests/bugs/vis/bug24989 b/tests/bugs/vis/bug24989
new file mode 100755 (executable)
index 0000000..8014dd0
--- /dev/null
@@ -0,0 +1,11 @@
+puts "============"
+puts "OCC24989"
+puts "============"
+puts ""
+#######################################################################
+# Visualization - workaround vc12 32-bit compiler optimizer bug resulted in crash in AIS_Axis
+#######################################################################
+
+vinit
+vtrihedron vtr
+set only_screen 1