From 6f6be66842065704e103fe4394c5986aa4b66136 Mon Sep 17 00:00:00 2001 From: Dmitrii Kulikov <164657232+AtheneNoctuaPt@users.noreply.github.com> Date: Tue, 5 May 2026 18:16:32 +0100 Subject: [PATCH] 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. --- .../ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx index 55441ff25e..0edd195158 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx @@ -2129,9 +2129,9 @@ void ShapeConstruct_ProjectCurveOnSurface::insertAdditionalPointOrAdjust( aNewPoints2d.SetValue(i + 1, thePoints2d(i)); } - thePoints = aNewPoints; - theParams = aNewParams; - thePoints2d = aNewPoints2d; + thePoints = std::move(aNewPoints); + theParams = std::move(aNewParams); + thePoints2d = std::move(aNewPoints2d); theIndex++; } else