mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-10 01:20:50 +08:00
Shape Healing - Crash in ShapeConstruct_ProjectCurveOnSurface::insertAdditionalPointOrAdjust() (#1267)
To input parameters of ShapeConstruct_ProjectCurveOnSurface::insertAdditionalPointOrAdjust() new arrays were assigned. The size of new arrays are guaranteed to be 1 element larger that original array. NCollection_Array1::Assign() is guaranteed to throw exception when arrays size mismatch. So, given that assignment code is reached, function will always throw. Fixed by calling move assignment instead - size mismatch is allowed in this case. Also it is more optimal.
This commit is contained in:
@@ -2129,9 +2129,9 @@ void ShapeConstruct_ProjectCurveOnSurface::insertAdditionalPointOrAdjust(
|
|||||||
aNewPoints2d.SetValue(i + 1, thePoints2d(i));
|
aNewPoints2d.SetValue(i + 1, thePoints2d(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
thePoints = aNewPoints;
|
thePoints = std::move(aNewPoints);
|
||||||
theParams = aNewParams;
|
theParams = std::move(aNewParams);
|
||||||
thePoints2d = aNewPoints2d;
|
thePoints2d = std::move(aNewPoints2d);
|
||||||
theIndex++;
|
theIndex++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user