Archived issue #0025501
TNaming::Displace calls itself recursively with default parameter.
Description
void TNaming::Displace (const TDF_Label& L,
const TopLoc_Location& Loc,
const Standard_Boolean WithOld)
{
for (TDF_ChildIterator ciL(L); ciL.More(); ciL.Next()) {
Displace (ciL.Value(),Loc); // BUG: the recursive call might need the parameter WithOld e.g. Displace (ciL.Value(),Loc, WithOld);
}
}
const TopLoc_Location& Loc,
const Standard_Boolean WithOld)
{
for (TDF_ChildIterator ciL(L); ciL.More(); ciL.Next()) {
Displace (ciL.Value(),Loc); // BUG: the recursive call might need the parameter WithOld e.g. Displace (ciL.Value(),Loc, WithOld);
}
}
Steps to reproduce
Fixed in branch CR25501.
Test case - NA.
Test case - NA.
Public activity
6 archived notes
Participants are labeled by their role within this record.
Could you attach a testing script allowing to reproduce the problem.
Thanks.
Thanks.
Hi szy,
This bug is very easy to find by static code analysis. I have attached the fix in the comment.
There is a correct version in OCCT QADraw package.
opencascade-6.8.0\src\QANewBRepNaming\QANewBRepNaming.cxx
void QANewBRepNaming::Displace (const TDF_Label& theLabel,
const TopLoc_Location& theLoc,
const Standard_Boolean theWithOld)
This bug is very easy to find by static code analysis. I have attached the fix in the comment.
There is a correct version in OCCT QADraw package.
opencascade-6.8.0\src\QANewBRepNaming\QANewBRepNaming.cxx
void QANewBRepNaming::Displace (const TDF_Label& theLabel,
const TopLoc_Location& theLoc,
const Standard_Boolean theWithOld)
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: szy
Date: Wed Mar 4 14:58:37 2015 +0300
Patch to fix misprint in method Displace ().
[revision removed]
Detailed log of new commits:
Author: szy
Date: Wed Mar 4 14:58:37 2015 +0300
Patch to fix misprint in method Displace ().
Reviewed.
Dear Commenter 1,
Branch CR25501 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 18 (18 on master)
Windows: 2 (2 on master)
products component :
Linux: 11 (11 on master)
Windows: 4 (4 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
occt component :
Total MEMORY difference: 91907337 / 91875321
Total CPU difference: 59044.25000000029 / 59518.86999999998
products component :
Total MEMORY difference: 23443722 / 23383466
Total CPU difference: 16318.189999999973 / 16551.239999999983
Testing on Windows:
occt component :
Total MEMORY difference: 57946261 / 57944267
Total CPU difference: 30464.90625 / 38926.375
products component :
Total MEMORY difference: 16200522 / 16209637
Total CPU difference: 9786.90625 / 9535.171875
There are no differences in images found by testdiff.
Branch CR25501 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 18 (18 on master)
Windows: 2 (2 on master)
products component :
Linux: 11 (11 on master)
Windows: 4 (4 on master)
Regressions/Differences:
No regressions/differences
Testing cases:
Not needed
Testing on Linux:
occt component :
Total MEMORY difference: 91907337 / 91875321
Total CPU difference: 59044.25000000029 / 59518.86999999998
products component :
Total MEMORY difference: 23443722 / 23383466
Total CPU difference: 16318.189999999973 / 16551.239999999983
Testing on Windows:
occt component :
Total MEMORY difference: 57946261 / 57944267
Total CPU difference: 30464.90625 / 38926.375
products component :
Total MEMORY difference: 16200522 / 16209637
Total CPU difference: 9786.90625 / 9535.171875
There are no differences in images found by testdiff.
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]