DiscussionsIssue archiveOCCT:Foundation Classes

Archived issue #0021954

Problem of copying object to itself reported by Valgrind in SortTools_QuickSort

CommunityOCCT:Foundation Classesclosed4 public notes

Search issues

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.

Public activity

4 archived notes

Participants are labeled by their role within this record.

01Commenter 1
The proposed solution seems acceptable because prevents exchange item with itself.
02Commenter 2
Corrected file is attached
03Commenter 3
Has to be checked and closed
04Commenter 4
SortTools package has been eliminated in context of #0024859