Archived issue #0021954
Problem of copying object to itself reported by Valgrind in SortTools_QuickSort
Description
The problem is reported by OCCT user Jiangtao Hu on 2009-04-07 on the
Projects / Contributions section of opencascade.org,
see http://www.opencascade.org/org/community/projects/?project_id=228:
----
Run opencascade against valgrind, it gives error on overlapping memory for
Attachment 1 (GXX) : 32.
I added a check at line 32:
32 if(Middle != (Right - 1)) ----Added check
33 Exchange(TheArray(Middle), TheArray(Right - 1));
The valgrind errors went away.
Jane
-----
The implementation of this function needs revision: it seems that it does not
guarantee that these exchanged elements will be exchanges back in all
situations.
Projects / Contributions section of opencascade.org,
see http://www.opencascade.org/org/community/projects/?project_id=228:
----
Run opencascade against valgrind, it gives error on overlapping memory for
Attachment 1 (GXX) : 32.
I added a check at line 32:
32 if(Middle != (Right - 1)) ----Added check
33 Exchange(TheArray(Middle), TheArray(Right - 1));
The valgrind errors went away.
Jane
-----
The implementation of this function needs revision: it seems that it does not
guarantee that these exchanged elements will be exchanges back in all
situations.
Public activity
4 archived notes
Participants are labeled by their role within this record.
The proposed solution seems acceptable because prevents exchange item with itself.
Corrected file is attached
Has to be checked and closed
SortTools package has been eliminated in context of #0024859