return NewMat;
}
+// On macOS 10.13.6 with XCode 9.4.1 the compiler has a bug leading to
+// generation of invalid code when method gp_Mat::Transpose() is called
+// for a matrix which is when applied to vector; it looks like vector
+// is transformed before the matrix is actually transposed; see #29978.
+// To avoid this, we disable compiler optimization here.
+#if defined(__APPLE__) && (__apple_build_version__ > 9020000)
+__attribute__((optnone))
+#endif
inline void gp_Mat::Transpose ()
{
Standard_Real Temp;
if (shape == gp_Identity) { }
else if (shape == gp_Translation || shape == gp_PntMirror) loc.Reverse();
else if (shape == gp_Scale) {
- Standard_Real As = scale;
- if (As < 0) As = - As;
- Standard_ConstructionError_Raise_if (As <= gp::Resolution(), "gp_Trsf::Invert() - transformation has zero scale");
+ Standard_ConstructionError_Raise_if (Abs(scale) <= gp::Resolution(), "gp_Trsf::Invert() - transformation has zero scale");
scale = 1.0 / scale;
loc.Multiply (-scale);
}
else {
- Standard_Real As = scale;
- if (As < 0) As = - As;
- Standard_ConstructionError_Raise_if (As <= gp::Resolution(), "gp_Trsf::Invert() - transformation has zero scale");
+ Standard_ConstructionError_Raise_if (Abs(scale) <= gp::Resolution(), "gp_Trsf::Invert() - transformation has zero scale");
scale = 1.0 / scale;
matrix.Transpose ();
loc.Multiply (matrix);